Forum Discussion

KwaXi's avatar
KwaXi
New Contributor
13 years ago

Problem with complex types in WSDL

Hello,

I've a WSDL with the following types:


<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://service/" elementFormDefault="unqualified" targetNamespace="http://service/" version="1.0">
<xs:element name="entity" type="tns:mainCheckTable"/>
<xs:element name="newMainCheckTableEntity" type="tns:newMainCheckTableEntity"/>
<xs:element name="newMainCheckTableEntityResponse" type="tns:newMainCheckTableEntityResponse"/>
<xs:complexType name="newMainCheckTableEntity">
<xs:sequence>
<xs:element ref="tns:entity"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="mainCheckTable">
<xs:sequence>
<xs:element name="0" type="xs:string"/>
<xs:element name="1" type="xs:string"/>
<xs:element name="2" type="xs:string"/>
<xs:element name="3" type="xs:string"/>
<xs:element name="4" type="xs:string"/>
<xs:element name="5" type="xs:string"/>
<xs:element name="6" type="xs:boolean"/>
<xs:element name="7" type="xs:string"/>
<xs:element name="8" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="newMainCheckTableEntityResponse">
<xs:sequence>
<xs:element name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>


The wsdl is generated by Apache CXF (code-first approach). Unfortunately soapUI doesn't generate a valid request for the webmethods which use the a parameter of type mainCheckTable.
  • KwaXi's avatar
    KwaXi
    New Contributor
    I forgot to provide the request soapUI produces and the response the webservice generates:

    Request:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service/">
    <soapenv:Header/>
    <soapenv:Body>
    <ser:newMainCheckTableEntity>
    <ser:entity>
    <date>2013.01.23 00:00:00</date>
    <1>service</1>
    <2>profile</2>
    <3>localhost</3>
    <4>profile</4>
    <5>profile</5>
    <6>true</7>
    <7>soapUI</7>
    <8>soapUI</8>
    </ser:entity>
    </ser:newMainCheckTableEntity>
    </soapenv:Body>
    </soapenv:Envelope>


    Response:

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Client</faultcode>
    <faultstring>Unmarshalling Error: unerwartetes Element (URI:"http://service/", lokal:"entity"). Erwartete Elemente sind &lt;{}entity></faultstring>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>


    I wrote simple Client using Apache CXF which works flawlessly also some other tools do not have any problems with the WSDL as it is.

    Anybody who had similar problems with soapUI and found a solution or is this simply a bug in soapUI?
  • Hi,

    The <date>2013.01.23 00:00:00</date> element doesn't look like it needs to be in the request based off the mainCheckTable definition in the schema . Can you confirm whether the ordering of the request is correct? Also if you can attach your wsdl file I can further look at this.