在SoapUI中导入WSDL时出错

cst*_*rtz 8 wsdl soapui

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

加载[file:\ C:\ chad.wsdl]时出错:org.apache.xmlbeans.XmlException:org.apache.xmlbeans.XmlException:error:不关闭标记

这是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>
Run Code Online (Sandbox Code Playgroud)

我的WSDL似乎验证了.

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

Rao*_*Rao 2

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

原线

<wsdl:documentation>WSDL File for HelloService</documentation>
Run Code Online (Sandbox Code Playgroud)

变成

<wsdl:documentation>WSDL File for HelloService</wsdl:documentation>
Run Code Online (Sandbox Code Playgroud)

这是更新后的 wsdl

<wsdl:documentation>WSDL File for HelloService</documentation>
Run Code Online (Sandbox Code Playgroud)