If you have a WCF service and tried t update/add a reference into the Visual Studio project, but then you get this error:
The document was understood, but it could not be processed. The WSDL doucmnet contains links t hat could not be resolved. There was an error downloading “http:://localhost:portnumber/server/service/?xsd=1” Unable to connnect to remote server. No connection could be made because the target machine actively refused it…. “
The root cause of this issue is that when Visual Studio tries to update the proxy class files from the URL: http://servername/services/client/xxx?wsdl, Visual Studio is reading the WSDL xml file. Inside this xml file, there is an element <xsd:import schemalocation=”http://localhost:8080/services/client/01.xsd=1″ … /> So VS tries to go to localhost server instead and made a fail attempt to download the xsd file because localhost is your desktop IIS that does not have this web service installed.
- Go to IE Browser and open the web service ?wsdl URL
- Download the WSDL and rename it as 01.xml file and put it a location path on your desktop
- Edit 01.xml and change the element <xsd:import schemalocation=”http://localhost:8080/services/client/01.xsd=1″ …/> to point to the actual web service URL. Save the xml file.
- In VS, change the web service URL address from https to the actual location of downloaded 01.xml that was done in step 2
- Update the web service in VS