【发布时间】:2012-01-03 18:34:01
【问题描述】:
我正在尝试从我的 .Net Web 应用程序中添加和调用 PHP Web 服务。 我尝试在this 教程中添加参考,但收到此错误。
The HTML document does not contain Web service discovery information.
我看到了调用的方法。我运行了 svcutil,它返回了一些元数据和同样的错误。我也尝试了 wsdl.exe 并得到了同样的错误。我无法理解前进的最佳方式是什么。 我已经阅读了很多 SO 帖子和文章,但现在感觉有点困惑。 任何帮助都会非常感谢
编辑: 这是页面生成的xml。
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://leopard-ext.its-dispatch.com/ws/request.php" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://leopard-ext.its-dispatch.com/ws/request.php">
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://leopard-ext.its-dispatch.com/ws/request.php">
<s:element name="fetchImport">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="accessKey" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="requestURL" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="requestFunction" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="requestType" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ID" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="fetchImportResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="fetchImport" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getLoads">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="accessKey" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getLoadsResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="getLoads" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
<message name="fetchImportSoapIn">
<part name="parameters" element="tns:fetchImport" />
</message>
<message name="fetchImportSoapOut">
<part name="parameters" element="tns:fetchImportResponse" />
</message>
<message name="getLoadsSoapIn">
<part name="parameters" element="tns:getLoads" />
</message>
<message name="getLoadsSoapOut">
<part name="parameters" element="tns:getLoadsResponse" />
</message>
<portType name="ITSDispatchServiceSoap">
<operation name="fetchImport">
<input message="tns:fetchImportSoapIn" />
<output message="tns:fetchImportSoapOut" />
</operation>
<operation name="getLoads">
<input message="tns:getLoadsSoapIn" />
<output message="tns:getLoadsSoapOut" />
</operation>
</portType>
<binding name="ITSDispatchServiceSoap" type="tns:ITSDispatchServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="fetchImport">
<soap:operation soapAction="http://leopard-ext.its-dispatch.com/ws/request.php/fetchImport" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="getLoads">
<soap:operation soapAction="http://leopard-ext.its-dispatch.com/ws/request.php/getLoads" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="ITSDispatchService">
<port name="ITSDispatchServiceSoap" binding="tns:ITSDispatchServiceSoap">
<soap:address location="http://leopard-ext.its-dispatch.com/ws/request.php" />
</port>
</service>
</definitions>
【问题讨论】:
-
有问题的 Web 服务是否为您公开了 WSDL?
-
@plenderj 不像 wcf 服务那样。看起来它只是一个带有 4 个文本框的 php 页面。它应该公开一个 wsdl
-
@plenderj 我试图下载 wsdl 保存它并从 vs cmd 提示符运行 wdsl.exe 并输出到一个 vb 文件它给了我一个错误。 XML 文档 中的错误不是预期的。
-
您说您尝试下载 wsdl - 您实际上有指向 WSDL 的链接吗?如果您在网络浏览器中查看它,您应该会看到 XML 等?
-
@plenderj 我必须查看源代码才能看到 xml。
标签: php .net vb.net web-services