The HTML document does not contain Web service discovery information

Karthikeyan Rajagopalan 1 Reputation point
2022-05-23T12:42:19.093+00:00

We have a simple SOAP based Web service deployed in Azure. We have added authentication feature, to use Microsoft as identity provider. While importing the WSDL as service reference in .NET Framework C# console application, we get the following error:-

The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'https://testsoapws.azurewebsites.net/WebS1.asmx?WSDL'.
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer realm="testsoapws.azurewebsites.net" authorization_uri="https://login.microsoftonline.com/3afdd2b8-3004-4b5f-9ca6-dce3d1f9d1c5/oauth2/v2.0/authorize" resource_id="c4b8fbd3-8848-473d-8935-76a038da52b0"'.
The remote server returned an error: (401) Unauthorized.
If the service is defined in the current solution, try building the solution and adding the service reference again.

What is missing? We are exploring accessing SOAP based Web service with authentication in a standalone program, which later we will integrate as a feature in our product. The programmatic steps to consume such a service is what we are interested in.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,548 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,218 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.