Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SOAP envelope doesn't match WSDL

    I'm using XMLTools.loadWSDL to access an existing web service. The "findAllForNameContains" operation has an input message where the first part is named "environment" which is a complex type "ipmsEnvironment" consisting of two elements; environmentName and userId. Here are the relevant parts of the wsdl.
    Code:
    <xs:complexType name="ipmsEnvironment">
    <xs:sequence>
    <xs:element minOccurs="0" name="environmentName" type="xs:string" />
    <xs:element minOccurs="0" name="userId" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    
    </wsdl:operation>
    <wsdl:operation name="findAllForNameContains">
    <wsdl:input message="tns:findAllForNameContains" name="findAllForNameContains"></wsdl:input>
    <wsdl:output message="tns:findAllForNameContainsResponse" name="findAllForNameContainsResponse"></wsdl:output>
    </wsdl:operation>
    
    <wsdl:message name="findAllForNameContains">
    <wsdl:part name="environment" type="tns:ipmsEnvironment"></wsdl:part>
    <wsdl:part name="nameContains" type="xsd:string"></wsdl:part>
    </wsdl:message>
    The problem is that the SOAP request envelope looks like this.
    Code:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Header/>
        <soap:Body>
            <opNS:findAllForNameContains xmlns:opNS="http://services.merchandise.ipms.islandpacific.com/">
                <ipmsEnvironment>
                    <environmentName>IPTSFILX</environmentName>
                    <userId>JFISHER</userId>
                </ipmsEnvironment>
                <nameContains>A</nameContains>
            </opNS:findAllForNameContains>
        </soap:Body>
    </soap:Envelope>
    The <ipmsEnvironment> element should be called <environment>; the name of the part, not the name of it's type. When I attempt to call the service, the server returns the following error.
    Code:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Server</faultcode>
    <faultstring>Found element ipmsEnvironment but could not find matching RPC/Literal part</faultstring>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    A call to the service with the same SOAP envelope, but with the "ipmsEnvironment" element changed to the correct name of "environment" works fine. This happens when I use the WSDL tab in the developer's console to access the service, so I'm sure it isn't anything I'm doing wrong in my code. ??

    #2
    There's a known bug right now with RPC literal SOAP encoding. Are you able to switch to document encoding? That's considered better for interop and other reasons.

    Comment


      #3
      In this case we are able to easily switch to document encoding and that worked. Thanks for the help.

      Comment

      Working...
      X