We are currently experiencing an issue with python Suds plugin, where the wsdl from a webservice is not being correctly interpreted to construct the XML request submission.  The WSDL and expected XML are simple enough.

We are running python 2.7, suds 0.4 on Centos kernel 2.6.18-194.11.1.el5

The issue seems to be that we have a <xsd:sequence> which defines a <xsd:choice> of 2 elements then a single <xsd:element>. This sequence tag seems to create an additional parent element around its child elements, so the XML result is not valid according to the WSDL.

The XML output we get is:     

<ns0:ProcessOrdersRequest>
         <ns0:profileNote0>                           <!-- UNDEFINED IN WSDL -->
            <ns0:MarkOrdersPacked>
               <ns0:carrierDetails>
                  <ns0:orderId>100</ns0:orderId>
                  <ns0:carrier>Carrier1</ns0:carrier>
                  <ns0:conNote>123456</ns0:conNote>
               </ns0:carrierDetails>
            </ns0:MarkOrdersPacked>
            <ns0:profileNote0>
               <ns0:note>Nevada Ship Verification process</ns0:note>
               <ns0:noteType>Internal</ns0:noteType>
            </ns0:profileNote0>
         </ns0:profileNote0>
                          <!-- UNDEFINED IN WSDL -->
      </ns0:ProcessOrdersRequest>


This is not consistent with the object output
from the client factory:

(ProcessOrdersRequest){
   MarkOrdersPacked =
      (MarkOrdersPacked){
         carrierDetails[] =
            (CarrierDetails){
               orderId = "100"
               carrier = "Carrier1"
               conNote = "123456"
            },
      }
   profileNote0 =
      (ProfileNoteInputType0){
         note = "Nevada Ship Verification process"
         noteType = "Internal"
      }
 }


The WSDL request element is defined as:

    <xsd:element name="ProcessOrdersRequest">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:choice>
                    <!-- Mark Orders Packed -->
                    <xsd:element maxOccurs="1" minOccurs="1" name="MarkOrdersPacked" type="tns:MarkOrdersPacked"/>
                    <!-- AnotherRequest -->
                    <xsd:element maxOccurs="1" minOccurs="1" name="AnotherRequest" type="tns:AnotherRequest"/>
                </xsd:choice>
                <xsd:element maxOccurs="1" minOccurs="0" name="profileNote0" type="tns:ProfileNoteInputType0"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>


Therefore we expect the XML to be:

      <ns0:ProcessOrdersRequest>
            <ns0:MarkOrdersPacked>
               <ns0:carrierDetails>
                  <ns0:orderId>100</ns0:orderId>
                  <ns0:carrier>Carrier1</ns0:carrier>
                  <ns0:conNote>123456</ns0:conNote>
               </ns0:carrierDetails>
            </ns0:MarkOrdersPacked>
            <ns0:profileNote>
               <ns0:note>Nevada Ship Verification process</ns0:note>
               <ns0:noteType>Internal</ns0:noteType>
            </ns0:profileNote>
      </ns0:ProcessOrdersRequest>
   </ns1:Body>
</SOAP-ENV:Envelope>

We have tested the wsdl against SoapUI from eviware.com as well as created a java client using jaxb which both interpret the wsdl and create an XMLrequest exactly as expected so I dont expect that there is an issue with the wsdl definition at all.

Attached is the complete wsdl, XML output and python app.

Any help appreciated.


Cheers,
David