Hello Every One,
I want to connect to a HTTPS web service from AL Code ,here is the AL code
HttpRequestMessage.Method('POST');
HttpRequestMessage.GetHeaders(HttpHeaders);
HttpHeaders.Add('Method', 'POST');
AuthText := StrSubstNo('%1:%2','Username','Password');
TempBlob.WriteAsText(AuthText,TextEncoding::Windows);
HttpHeaders.Add('Authorization',StrSubstNo('BASIC %1',TempBlob.ToBase64String()));
// OutputContentText := GlobalRequestText;
HttpContent.WriteFrom(OutputContentText);
HttpContent.GetHeaders(HttpHeadersContent);
HttpHeadersContent.Remove('Content-Type');
HttpHeadersContent.Add('Content-Type', 'application/soap+xml;charset=UTF-8;action="'+WSAction+'"');
HttpRequestMessage.Content(HttpContent);
HttpClient.SetBaseAddress(Url);
//HttpClient.
//_HttpClient.AddCertificate();
HttpClient.AddCertificate('');
MESSAGE(OutputContentText);
if HttpClient.Post('https://SomeServerName/SomeService.svc',HttpContent,HttpResponse) then
//if HttpClient.Send(HttpRequestMessage, HttpResponse) then
MESSAGE('GenerateLabelFromASN - Request Succefully Sent...')
else
Message('TO BADDDD....');
I get an ERROR(an ERROR Occured) while sending request.
My questions is ,
1- is it supported the https connection in Dynamics 365 AL
2- how can i add certificate to HttpClient Object.
3- do i need to HOST the SSL certificate in Azure or somewhere.
4- How to Ignore SSL certificate from the request,if can not add a certificate.
Thanks
Categories: