I have URL to web service WSDL:
http://www.webservicex.net/WeatherForecast.asmx?WSDL
I am trying to consume this service in a WPF application (.Net 4.5) in Visual Studio 2012.
I right click on the project -> Add Service Reference and when I try to add the above service reference, I get the following error:
The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be resolved: ' http://www.webservicex.net/WeatherForecast.asmx?WSDL '. Metadata contains a reference that cannot be resolved: ' http://www.webservicex.net/WeatherForecast.asmx?WSDL '. If the service is defined in the current solution, try building the solution and adding the service reference again.
On "Add Service Reference" window, I now click on "Advanced" button -> "Add Web Reference" button on the bottom -> copy the URL into URL textbox and click "->" button. I see the WSDL in the viewer.
Now I click on "Cancel" and again "Cancel" on "Service Reference Settings" window.
On "Add Service Reference" window, I click "Go" now and I see the Services available to add to the project.
Is this a Visual Studio issue? Why do I have to do that. Why does it not work the first time? Am I missing something on my machine?
I've tried to 'Add Service Reference' for the URL you provided in Microsoft Visual Studio 2010 ( Version 10.0.40219.1 SP1Rel ), Microsoft Visual Studio Ultimate 2012 ( Version 11.0.61030.00 Update 4 ) and in Microsoft Visual Studio Ultimate 2013 ( Version 12.0.30501.00 Update 2 ) and it's working perfect in all of them.
So I can suppose 3 options.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.