views:

25

answers:

1

I am trying to add a SOAP service using VS 2005 via add web reference. However when I add the reference, I get all options disabled and the following error. What am I doing wrong?

The document at the url http://interface.postcodechecker.co.uk/wsdl/pccInterface.wsdl was not recognized as a known document type. The error message from each known type may help you fix the problem:

  • Report from 'DISCO Document' is 'Discovery document at the URL http://interface.postcodechecker.co.uk/wsdl/pccInterface.wsdl could not be found.'.
    • The document format is not recognized (the content type is 'application/wsdl+xml').
  • Report from 'WSDL Document' is 'There is an error in XML document (73, 30).'.
    • Namespace prefix 'soapenc' is not defined.
  • Report from 'XML Schema' is 'The root element of a W3C XML Schema should be and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'.
+1  A: 

Looks to me like they fumbled the schema. Save the .wsdl to a file and open it in a text editor. Add two lines to the header so it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Postcodes"
   targetNamespace="http://interface.postcodechecker.co.uk/wsdl/pccSOAP.wsdl"
   xmlns="http://schemas.xmlsoap.org/wsdl/"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:tns="http://interface.postcodechecker.co.uk/wsdl/pccSOAP.wsdl"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
         xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"&gt; 
   <types>
   etc...

The two added lines are indented, note that the angle bracket was moved. Then just load the service reference from the file.

Hans Passant
Tried that too, but to no avail. I am still getting the same error.
Farax
Worked fine on my machine. Contact the company if you need support.
Hans Passant
yea ... sent them an email ... meanwhile I would try this again ... perhaps I am missing something else
Farax
It worked after I changed it again ... apparently there was some glitch when I had changed it the first time and I hadnt saved it correctly. Thanks !
Farax
Please review this: http://meta.stackoverflow.com/questions/686/accepting-answer-without-upvoting
Hans Passant
I am wondering if you hav ne idea about a new error thats been popping up recently. (Unable to import binding 'pcc_Binding' from namespace 'http://interface.postcodechecker.co.uk/wsdl/pccSOAP.wsdl')Seems odd
Farax