【问题标题】:Error in WSDL: the document is not a definitions document elementWSDL 中的错误:文档不是定义文档元素
【发布时间】:2018-12-27 06:02:06
【问题描述】:

我的 wsdl 中出现以下错误:

文档不是定义@http://schemas.xmlsoap.org/wsdl/:文档元素命名空间不匹配预期“http://schemas.xmlsoap.org/wsdl/”得到“”

有人知道吗?

提前致谢, 艾玛

<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="http://osb.vodafone.com/gr/RTI_OSB_Siebel" xmlns:tns="http://osb.vodafone.com/gr/RTI_OSB_Siebel" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema/">
<types>
    <xsd:schema targetNamespace="http://osb.vodafone.com/gr/RTI_OSB_Siebel">
    <xsd:element name="retrieveInformationResponse" type="xsd:retrieveInformationResponseInfo"/>
      <xsd:complexType name="retrieveInformationResponseInfo">
        <xsd:sequence>
          <xsd:element name="retrieveInformationResponse" maxOccurs="1" minOccurs="1" type="xsd:retrieveInformationResponseInfo"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="retrieveInformationResponse">
        <xsd:sequence>
          <xsd:element name="Response" maxOccurs="1" minOccurs="1" type="xsd:retrieveInformationResponse"/>
        </xsd:sequence>
      </xsd:complexType>      
        <xsd:complexType name="retrieveInformationResponseInfo">
            <xsd:sequence>
                <xsd:element name="Customer" maxOccurs="1" minOccurs="0" type="xsd:customerInfo"/>
                <xsd:element name="Asset" maxOccurs="1" minOccurs="0" type="xsd:assetInfo"/>
                <xsd:element name="TroubleTicket" maxOccurs="1" minOccurs="0" type="xsd:troubleTicketInfo"/>
                <xsd:element name="Order" maxOccurs="1" minOccurs="0" type="xsd:orderInfo"/>
            </xsd:sequence>
        </xsd:complexType>

。 . . .

</xsd:schema>
</types>
<message name="retrieveInformationRequest">
    <part name="voiceNumber" type="xsd:string"/>
<part name="serviceId" type="xsd:string"/>
<part name="ttId" type="xsd:string"/>
</message>
<message name="retrieveInformationResponse">
    <part name="errorCode" type="xsd:string"/>
    <part name="errorMessage" type="xsd:string"/>
    <part name="Response" type="xsd:retrieveInformationResponseInfo"/>
</message>
<portType name="retrieveInformation">
    <operation name="retrieveInformation">
        <input message="tns:retrieveInformationRequest"/>
        <output message="tns:retrieveInformationResponse"/>
    </operation>
</portType>
<binding name="retrieveInformation" type="tns:retrieveInformation">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
    <operation name="retrieveInformation">
        <soap:operation soapAction=""/>
        <input>
            <soap:body use="literal"/>
        </input>
        <output>
            <soap:body use="literal"/>
        </output>
    </operation>
</binding>
<service name="retrieveInformationService">
    <port binding="tns:retrieveInformation" name="retrieveInformation">
        <soap:address location="http://OSBhostname.org:8080/RTI_OSB_Siebel"/>
    </port>
</service>

【问题讨论】:

    标签: xml wsdl definitions


    【解决方案1】:

    您需要通过在xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 中定义的别名“wsdl”作为前缀,为特定于wsdl 的元素明确指定wsdl 命名空间。

    例如

    <wsdl:definitions ...etc.>
    <wsdl:types>
    

    【讨论】:

    • 那么,我不明白。错误是说 &lt;definitions&gt; 元素,即文档元素,没有命名空间。在你上面的例子中是真的。如果将其更改为&lt;wsdl:definitions&gt;,您确定会得到相同的错误吗?
    • 不,我得到一个不同的错误:WSDL 在语义上无效:在消息“{http://osb.vodafone.com/gr/RTI_OSB_Siebel”中为部分“voiceNumber”指定的元素或类型在此 wsdl 引用的任何模式中都找不到 }retrieveInformationRequest'。我以前没有得到的仍然无法理解错在哪里..
    • 你正在取得进步。您已经消除了第一个错误 - 现在您需要更正支持架构定义中的错误。你能把你对元素retrieveInformationRequest的定义放在你的问题中吗?
    • 关于retrieveInformationRequest,除了上面列出的之外,我没有其他任何东西,在中间代码中我所做的就是定义retrieveInformationResponse 元素
    • 好吧,我不确定究竟是什么导致了该错误,但在您的&lt;wsdl:types&gt; 部分中,您已将诸如“retrieveInformationResponse”之类的元素定义为具有“xsd:retrieveInformationResponseInfo”类型。这肯定是错误的,因为它是您的目标命名空间“osb.vodafone.com/gr/RTI_OSB_Siebel”的一部分,而不是“xsd”命名空间的一部分。尝试摆脱您自己定义的类型的“xsd”别名。
    猜你喜欢
    • 2013-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-08
    • 2017-07-11
    • 1970-01-01
    • 2022-10-17
    • 2023-02-02
    相关资源
    最近更新 更多