[Fedora-suds-list] Problem marshalling array of complexType

Steidten, Steffen steffen.steidten at amd.com
Mon Nov 17 16:26:22 UTC 2008


Hi,

While suds has recently made very good progress in handling arrays, I'm currently struggling with a message, containing an array of complex type. The array seems not being marshalled correctly.

The expected request must look like this:
...
<listData xsi:type="urn:ArrayOf_tns4_LotListReqData" soapenc:arrayType="com:LotListReqData[]"
	xmlns:urn="http://server/soap/service" xmlns:com="com.amd.extpriority.data">
	    <element>
	       <lotID xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">MyLot</lotID>
               <targetFacility xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Facility</targetFacil
ity>
	       <blocking xsi:type="xsd:int">1</blocking>
               <duration xsi:type="xsd:int">1</duration>
               <reset xsi:type="xsd:boolean">true</reset>
	    </element>	    
</listData>
...


Instead, suds (v0.3.2) generates an answer like this:
...
<listData xsi:type="intf:ArrayOf_tns4_LotListReqData" arrayType="LotListReqData">
    <element xmlns="http://server/soap/service" xsi:type="xs:string">
               <blocking xmlns="com.amd.extpriority.data" xsi:type="xs:int">1</blocking>
               <duration xmlns="com.amd.extpriority.data" xsi:type="xs:int">1</duration>
               <lotID xmlns="com.amd.extpriority.data" xsi:type="tns:string">MyLot</lotID>
               <reset xmlns="com.amd.extpriority.data" xsi:type="xs:boolean">true</reset>
               <targetFacility xmlns="com.amd.extpriority.data" xsi:type="tns:string">Facility</targetFacility>
     </element>
</listData>


Note the element tag in line #2 is generated as string type. Instead it should have no attributes or be of type LotListReqData.

The code to generate this message is:
...
cl = Client(url)
ll = cl.factory.create('ns0:LotListReqData')
ll.blocking = 1
ll.duration = 1
ll.reset = True
ll.lotID = "MyLot"
ll.targetFacility = "Facility"
aa = cl.factory.create("ArrayOf_tns4_LotListReqData")
aa.value = ll
...

Did I miss something, or is this possibly a bug or a missing feature in suds? 

Regards,
Steffen





More information about the fedora-suds-list mailing list