【发布时间】:2012-02-06 15:49:44
【问题描述】:
我承认我对 WSDL 很无知。我为我正在处理的项目提供了以下 WSDL,但它不起作用。这是我正在使用的 WSDL 的帖子。我被要求从 wsdl 中删除服务的实际 URL,以便它不会被爬虫索引和命中。实际 URL 已替换为“www.testsite.org”。这是 XML:
<wsdl:definitions xmlns:tns="https://www.testsite.org/uiws-test" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="uiicon" targetNamespace="https://www.testsite.org/uiws-test">
<!-- TYPES -->
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="https://www.testsite.org/uiws-test">
<xsd:complexType name="ResponseType">
<xsd:sequence>
<xsd:element name="request_id" type="xsd:string"/>
<xsd:element name="messages" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="responseType" type="tns:ResponseType"/>
<xsd:element name="ICON_MessageTrain" type="xsd:string"/>
<xsd:element name="fault" type="xsd:string"/>
</xsd:schema>
</wsdl:types>
<!-- MESSAGES -->
<wsdl:message name="RequestMessage">
<wsdl:part name="ICON_MessageTrain" element="tns:ICON_MessageTrain"/>
</wsdl:message>
<wsdl:message name="ResponseMessage">
<wsdl:part name="response" element="tns:responseType"/>
</wsdl:message>
<wsdl:message name="FaultMessage">
<wsdl:part name="fault" element="tns:fault"/>
</wsdl:message>
<wsdl:message name="SourceHeader">
<wsdl:part name="source" element="xsd:string"/>
</wsdl:message>
<wsdl:message name="ApplicationHeader">
<wsdl:part name="application" element="xsd:string"/>
</wsdl:message>
<!-- PORT TYPES -->
<wsdl:portType name="uiicon_portType">
<wsdl:operation name="uiicon">
<wsdl:input message="tns:RequestMessage"/>
<wsdl:output message="tns:ResponseMessage"/>
<wsdl:fault message="tns:FaultMessage" name="FaultMessage"/>
</wsdl:operation>
</wsdl:portType>
<!-- BINDINGS -->
<wsdl:binding name="uiicon_binding" type="tns:uiicon_portType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="uiicon">
<soap:operation soapAction="https://www.testsite.org/uiws-test/services/uiicon-test" style="document"/>
<wsdl:input>
<soap:header part="source" message="tns:SourceHeader" use="literal"/>
<soap:header part="application" message="tns:ApplicationHeader" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="FaultMessage">
<soap:fault name="FaultMessage" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<!-- SERVICES -->
<wsdl:service name="uiicon_service">
<wsdl:documentation>
This is the web service for UI-ICON data exchange modernization project
</wsdl:documentation>
<wsdl:port name="uiicon_port" binding="tns:uiicon_binding">
<soap:address location="https://www.testsite.org/uiws-test/services/uiicon-test"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
当我在 wsdl.exe 中运行它时,我收到以下错误:
- 无法导入操作“uiicon”。
- 缺少“http://www.w3.org/2001/XMLSchema:string”元素
我看到 wsdl 在哪里引用 w3.org 2001 架构,并且我看到了字符串架构引用。只是不确定它应该是什么样子以及为什么它是错误的。谢谢!
【问题讨论】:
标签: xml web-services wsdl