Search code examples
web-serviceswsdlsoapui

What is wrong with this WSDL? Why does SOAPUI generate a wrong request from this WSDL?


I have a curious problem with one of my WSDL's

When i create a new SOAP-project in SOAPUI and import the WSDL, SOAPUI generates an example request, but this request is missing the namespace and element for the operation.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <customers>
         <!--Zero or more repetitions:-->
         <customerId>?</customerId>
      </customers>
   </soapenv:Body>
</soapenv:Envelope>

Based on my WSDL and XSD, that I'll include at the end for reference, i would expect the request to look more like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:look="http://noa.otto.de/onlinecustomer/webservice/lookupadditionaldata">
   <soapenv:Header/>
   <soapenv:Body>
    <look:requestAdditionalCustomerData>
          <look:customers>
             <!--Zero or more repetitions:-->
             <look:customerId>?</look:customerId>
          </look:customers>
      </look:requestAdditionalCustomerData>
   </soapenv:Body>
</soapenv:Envelope>

But even when i "correct" the request like this manually it won't work and still produce a SOAPFault Exception on the server side, stating that it "Could not retrieve operation name from WS context"

That tells me that the problem is probably not in SOAPUI's ability to generate a correct request from a WSDL, but in my ability to define a correct WSDL :-)

Problem is, i have no more ideas what i could try, i've been at this for almost two days. So i thought maybe somebody else has an idea.

Any thoughts are apreciated and thanks in advance for your time!

regards Mario

Oh, and in case it matters, the webservice is deployed in a glassfish/payara 4.1.1

Here is my WSDL:

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:webservice="http://noa.otto.de/onlinecustomer/webservice/lookupadditionaldata" xmlns:lookupadditionaldata="http://noa.otto.de/onlinecustomer/schema/lookupadditionaldata" name="LookupAdditionalUniservData" targetNamespace="http://noa.otto.de/onlinecustomer/webservice/lookupadditionaldata">
<types>
  <xsd:schema>
    <xsd:import namespace="http://noa.otto.de/onlinecustomer/schema/lookupadditionaldata" schemaLocation="http://blade228.puc.ov.otto.de:52301/onlinecustomer/LookupAdditionalUniservData?xsd=1"/>
  </xsd:schema>
</types>

<message name="requestAdditionalCustomerDataRequest">
    <part name="customers" type="lookupadditionaldata:intArray"/>
</message>

<message name="requestAdditionalCustomerDataResponse">
    <part name="customerData" type="lookupadditionaldata:customerDataArray"/>
</message>

<portType name="LookupAdditionalUniservDataPort">
    <operation name="requestAdditionalCustomerData">
        <input message="webservice:requestAdditionalCustomerDataRequest"/>
        <output message="webservice:requestAdditionalCustomerDataResponse"/>
    </operation>
</portType>

<binding name="LookupAdditionalUniservDataPortBinding" type="webservice:LookupAdditionalUniservDataPort">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="requestAdditionalCustomerData">
        <documentation>collects customer account information for a given list of idCustomers</documentation>
        <soap:operation soapAction="requestAdditionalCustomerData" style="document"/>
        <input>
            <soap:body use="literal"/>
        </input>
        <output>
            <soap:body use="literal"/>
        </output>
    </operation>
</binding>

<service name="LookupAdditionalUniservDataService">
    <documentation>this service provides a means for the CASS/ENS/Uniserv system to collect additional customer account data</documentation>
    <port name="LookupAdditionalUniservDataPort" binding="webservice:LookupAdditionalUniservDataPortBinding">
        <soap:address location="http://blade228.puc.ov.otto.de:52301/onlinecustomer/LookupAdditionalUniservData"/>
    </port>
</service>

</definitions>

and here is the XSD:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://noa.otto.de/onlinecustomer/schema/lookupadditionaldata" targetNamespace="http://noa.otto.de/onlinecustomer/schema/lookupadditionaldata" version="1.0">

    <xs:complexType name="customerData">
        <xs:sequence>
            <xs:element name="accountBalance" type="xs:long" minOccurs="0"/>
            <xs:element name="birthday" type="xs:dateTime" minOccurs="0"/>
            <xs:element name="blockedOrderValue" type="xs:int" minOccurs="0"/>
            <xs:element name="city" type="xs:string" minOccurs="0"/>
            <xs:element name="combinedCreditWorthinessClass" type="xs:short" minOccurs="0"/>
            <xs:element name="companyId" type="xs:short" minOccurs="0"/>
            <xs:element name="creationDate" type="xs:dateTime" minOccurs="0"/>
            <xs:element name="custNo" type="xs:string" minOccurs="0"/>
            <xs:element name="blockades" minOccurs="0">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="blockade" type="tns:customerBlockade" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="dunningLevel" type="xs:string" minOccurs="0"/>
            <xs:element name="email" type="xs:string" minOccurs="0"/>
            <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
            <xs:element name="externalAccountBlockingSign" type="xs:byte" minOccurs="0"/>
            <xs:element name="externalBlockingSign" type="xs:byte" minOccurs="0"/>
            <xs:element name="externalCustomerType" type="xs:short" minOccurs="0"/>
            <xs:element name="firstName" type="xs:string" minOccurs="0"/>
            <xs:element name="houseNo" type="xs:string" minOccurs="0"/>
            <xs:element name="id" type="xs:int" minOccurs="0"/>
            <xs:element name="lastName" type="xs:string" minOccurs="0"/>
            <xs:element name="openBackorder" type="xs:int" minOccurs="0"/>
            <xs:element name="phone" type="xs:string" minOccurs="0"/>
            <xs:element name="salutation" type="xs:string" minOccurs="0"/>
            <xs:element name="street" type="xs:string" minOccurs="0"/>
            <xs:element name="weeklyCredit" type="xs:long" minOccurs="0"/>
            <xs:element name="zip" type="xs:string" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="customerBlockade">
        <xs:sequence>
            <xs:element name="blockadeAge" type="xs:long" minOccurs="0"/>
            <xs:element name="blockadeName" type="xs:string" minOccurs="0"/>
            <xs:element name="blockadeNumber" type="xs:short" minOccurs="0"/>
            <xs:element name="blockadeState" type="tns:blockadeState" minOccurs="0"/>
            <xs:element name="dominantBlockadeSign" type="xs:boolean" minOccurs="0"/>
            <xs:element name="paymentKey" type="xs:byte" minOccurs="0"/>
            <xs:element name="paymentKeyName" type="xs:string" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:simpleType name="blockadeState">
        <xs:restriction base="xs:string">
            <xs:enumeration value="ACTIVE"/>
            <xs:enumeration value="SUSPENDED"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="customerDataArray" final="#all">
        <xs:sequence>
            <xs:element name="item" type="tns:customerData" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
        </xs:sequence>
    </xs:complexType>
    <element name="customerDataArray" type="tns:customerDataArray"/>

    <xs:complexType name="intArray" final="#all">
        <xs:sequence>
            <xs:element name="customerId" type="xs:int" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
        </xs:sequence>
    </xs:complexType>
    <element name="intArray" type="tns:intArray"/>

</xs:schema>

Solution

  • I found out what causes this problem. It is an error in the WSDL. In both <message> definitions I use the attribute type="" inside the <part> elements. It should have been element="" instead of type="", then it works.