Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error importing a WSDL in SoapUI

Tags:

wsdl

soapui

I'm getting this message when attempting to create a new SoapUI project and import a WSDL for Web Service Simulation. The error message seems incomplete as it does not actually say what tag is not being closed.

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

Here's the 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>

My WSDL seems to validate.

I've found some similar issues online where the wsdl is imported from an http url and the import results in this same error, but i'm importing straight from my C drive (not over http) so the suggested solutions have not worked.

like image 356
csturtz Avatar asked Mar 18 '13 16:03

csturtz


1 Answers

There was a namespace issue in the following line

Original line

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

Changed to

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

Here is the updated 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>
like image 52
Rao Avatar answered Dec 06 '22 16:12

Rao