WebRequest.SetRequestUri('http://localhost:7047/BC130/WS/CRONUS%20Norge%20AS/Codeunit/GetReservation');
WebRequest.SetRequestUri('http://localhost:7047/BC130/WS/CRONUS%20Norge%20AS/Codeunit/GetReservation');
Thanks. I am using run time 2.3. This is only available from 3.0. Hope this is the issue with my scenario.
using AL Httpclient , they mentioned in developer preview 2018 it is supporting ntlm authentication and will be shipped in next release. I haven't checked yet whether it is now inside spring 2019 release.
community.dynamics.com/.../developer-preview-december-2018
Using .net httpweb request you might need to try UseDefaultCredential method
Service is setup for NTLM Authentication. How can I add method in request header?
For Windows Credential you need to use NTLM Authentication method in your request header and also you need to make sure "ServicesUseNTLMAuthentication" has been enabled on your BC On-Premise service.
Thanks for your responses.
It is not working in my PC, which is not in any domain and the Credential Type is windows.
But it is working with Docker/azure installation (where the Credential Type is NavUserPassword).
My working code is:
XmlDoc.WriteTo(RequestText);
Content.WriteFrom(RequestText);
Content.GetHeaders(ContentHeaders);
ContentHeaders.Remove('Content-Type');
ContentHeaders.Add('Content-Type', 'application/xml; charset=utf-8');
WebRequest.Content := Content;
WebRequest.GetHeaders(RequestHeaders);
WebRequest.SetRequestUri(URL);
WebRequest.Method('POST');
RequestText := strsubstNo('%1:%2', UserIDTxt, PasswordTxt);
TempBlob.WriteAsText(RequestText, TextEncoding::Windows);
RequestHeaders.Add('Authorization', StrSubstNo('Basic %1', TempBlob.ToBase64String()));
RequestHeaders.Add('Connection', 'keep-alive');
RequestHeaders.Add('SOAPAction', MySoapAction);
WebClient.Timeout := 30000;
WebClient.send(WebRequest, WebResponse);
Hi Reddy,
I think you can try with changing the WebRequest.SetRequestUri ... remove the localhost and use the IP address of the server as (192.168.0.0), it might be work incase of web service.
Thanks. But didn't work out.
In D365BC, go to Users, select your user and in the Web Service Access section click on Web Service Access Key in order to create the key.
Then, in your AL code use your username (without domain) and the web service access key as password.
Hei, we are using correct credentials. If we develop in C/AL with dotnet variables it is working. But we wanted to have the solution in extension.
I don't know how to use web service access key to the above. Please suggest, so we can try it as well.
Are you using the correct password? You need to use the generated web service access key.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156