0
votes

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

1 Answers

1
votes

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/"> 
   <types>
   etc...

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