Hi, I am trying to consume a Business Central webservices (SOAP) in an Azure function. The problem I have is that I do not know how to enter the credentials.
I am getting this error when I try to call any procedure from my SOAP: HTTP request is unauthorized with client authentication scheme 'Anonymous'
Thank you very much.
Please refer to this doc. how to generate a web service key for authentication
docs.microsoft.com/.../web-services-authentication
Related Topic
community.dynamics.com/.../how-to-test-api-s-in-d365-business-central
Hello, thank you very much for your answer. Currently I already have the Web Service Access Key established, and I do the test in postman as you suggest and it works perfectly, which I don't know how to pass those credentials through C # in my Azure Function.
Hello, I found the solution and I want to share it with you:
private static void InitializeEndPoint(string URI) { BasicHttpBinding myBinding = new BasicHttpBinding(); myBinding.Security.Mode = BasicHttpSecurityMode.Transport; myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None; myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName; myBinding.MaxReceivedMessageSize = 2147483647; myBinding.MaxBufferPoolSize = 2147483647; myBinding.MaxBufferSize = 2147483647; EndpointAddress endPoint = new EndpointAddress(URI); service = new ServiceClient(myBinding, endPoint); service.ClientCredentials.UserName.UserName = "UserName"; service.ClientCredentials.UserName.Password = "Password"; }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Sumit Singh 2,163
OussamaSabbouh 1,908
YUN ZHU 1,878 Super User 2025 Season 2