在SoapUI中而不是在Visual Studio中可访问的SOAP WSDL

SOAP WSDL accessible in SoapUI, not in Visual Studio

我正在尝试通过"添加服务引用"将SOAP Web服务集成到我的C#项目中,因为我至少已经成功完成了一次。该地址在SoapUI中正常工作,甚至在浏览器中输入地址也会按预期显示WSDL文件。但是,当我在"添加服务引用"对话框中输入地址时,会导致错误。

The document at the url [redacted].com/uesas/WebService/Onboard-2_0.cfc?wsdl was not
recognized as a known document type. The error message from each known type may help you fix the problem:

  • 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'.'.
  • Report from 'DISCO Document' is 'Discovery document at the URL [redacted].com/uesas/WebService/Onboard-2_0.cfc?wsdl could
    not be found.'.

    • The document format is not recognized.
  • Report from 'WSDL Document' is 'There is an error in XML document (2, 129).'.

    • The string 'http ://webservice.uesas._[redacted].webroot' is not a valid Uri value.

Metadata contains a reference that cannot be resolved: '[redacted].com/uesas/WebService/Onboard-2_0.cfc?wsdl'.
The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were:

...,后跟明显是HTML代码的前几行,而不是WSDL代码。因此,很明显,即使SoapUI和任何标准浏览器都确认其中存在,VS甚至都没有看到WSDL文件。有谁想过为什么呢?


在端点地址后添加?WSDL,例如:http://localhost:8088/mock_service?WSDL