WCF – The document was understood but it could not be processed

Problem

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&#8243; … /> 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.

 

Solution

  1. Go to IE Browser and open the web service ?wsdl URL
  2. Download the WSDL and rename it as 01.xml file and put it a location path  on your desktop
  3. Edit 01.xml and change the  element <xsd:import schemalocation=”http://localhost:8080/services/client/01.xsd=1&#8243; …/> to point to the actual web service URL. Save the xml file.
  4. In VS, change the web service URL address from https to the actual location of downloaded 01.xml that was done in step 2
  5.  Update the web service in VS

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s