[Fedora-suds-list] Suds not interpreting WSDL correctly?

David Hobley david.hobley at mionegroup.com
Thu Nov 25 02:23:28 UTC 2010


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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/suds/attachments/20101125/98a853c9/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uploadNevadaShipments.py
Type: text/x-python
Size: 2516 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/suds/attachments/20101125/98a853c9/attachment.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmlOutput.xml
Type: application/xml
Size: 1300 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/suds/attachments/20101125/98a853c9/attachment.rdf 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: webservice.wsdl
Type: application/xml
Size: 3662 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/suds/attachments/20101125/98a853c9/attachment-0001.rdf 


More information about the suds mailing list