gpt4 book ai didi

wsdl - 在 SoapUI 中导入 WSDL 时出错

转载 作者:行者123 更新时间:2023-12-04 08:49:36 25 4
gpt4 key购买 nike

我在尝试创建新的 SoapUI 项目并为 Web 服务模拟导入 WSDL 时收到此消息。错误消息似乎不完整,因为它实际上并没有说明什么标签没有被关闭。

Error loading [file:\C:\chad.wsdl]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: does not close tag



这是 WSDL:
    <wsdl:definitions name="Chad" targetNamespace="http://www.examples.com/wsdl/Chad.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.examples.com/wsdl/Chad.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<wsdl:message name="SayHiRequest">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="SayHiResponse">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>

<wsdl:portType name="Hello_PortType">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:SayHiRequest"/>
<wsdl:output message="tns:SayHiResponse"/>
</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHi">
<soap:operation soapAction="sayHi"/>
<wsdl:input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:input>
<wsdl:output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="Hello_Service">
<wsdl:documentation>WSDL File for HelloService</documentation>
<wsdl:port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address location="http://www.examples.com/chad/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

我的 WSDL 似乎已验证。

我在网上发现了一些类似的问题,其中 wsdl 是从 http url 导入的,导入导致同样的错误,但我直接从我的 C 驱动器(不是通过 http)导入,因此建议的解决方案没有奏效。

最佳答案

以下行中存在命名空间问题

原线

<wsdl:documentation>WSDL File for HelloService</documentation>

变成
<wsdl:documentation>WSDL File for HelloService</wsdl:documentation>

这是更新的 wsdl

<?xml version='1.0' encoding="UTF-8"?>
<wsdl:definitions name="Chad" targetNamespace="http://www.examples.com/wsdl/Chad.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.examples.com/wsdl/Chad.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="SayHiRequest">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="SayHiResponse">
<wsdl:part name="text" type="xsd:string"/>
</wsdl:message>

<wsdl:portType name="Hello_PortType">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:SayHiRequest"/>
<wsdl:output message="tns:SayHiResponse"/>
</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHi">
<soap:operation soapAction="sayHi"/>
<wsdl:input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:input>
<wsdl:output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="Hello_Service">
<wsdl:documentation>WSDL File for HelloService</wsdl:documentation>
<wsdl:port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address location="http://www.examples.com/chad/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

关于wsdl - 在 SoapUI 中导入 WSDL 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15481847/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com