Hey Jason,
The specification:
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/ says: "Arrays are
compound values (see also section 5.4.2). SOAP arrays are defined as having a type of
SOAP-ENC:Array or a type derived there from." This is tricky. Having the xsi:type
be
SOAP-ENC:Array may cause problems with some servers just as setting it to the derived type
is causing problems in yours. Do you know what kind of server you're talking to?
That said, we need to help you with you issue. I could add an option in 0.4 that would
allow the user to specify how suds should set the xsi:type for soap encoded arrays. Or, I
can tell you how to hack your suds. Which would you prefer?
Regards,
Jeff
On 03/31/2010 02:07 PM, Jason McKellar wrote:
I've got a WSDl that defines an array type:
<complexType name="ArrayOf_tns1_TenantServiceListInfo">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="tns1:TenantServiceListInfo[]"/>
</restriction>
</complexContent>
</complexType>
When I send a SOAP message to the server using Suds it sends this XML
for that type:
<in1 xsi:type="ns0:ArrayOf_tns1_TenantServiceListInfo"
ns3:arrayType="ns4:TenantServiceListInfo[1]">
<item xsi:type="ns4:TenantServiceListInfo">
<serviceListId xsi:type="ns4:ServiceListID">
<ownerId xsi:type="ns2:string">system</ownerId>
<serviceListName
xsi:type="ns2:string">busfeaturepack</serviceListName>
</serviceListId>
<tenantId xsi:type="ns2:string">demo</tenantId>
<totalLicenses
xsi:type="ns2:int">1</totalLicenses>
</item>
</in1>
The problem is the server will not accept it unless xsi:type is set to
SOAP-ENC:Array
So I have tried creating the object using (ns0 is the soap encoding xmlns):
>>> slr = c.factory.create('ns0:Array')
>>> slr
(Array){
_arrayType = ""
_offset = ""
_id = ""
_href = ""
}
>>> slr.item = items
>>> slr
(Array){
_arrayType = ""
_offset = ""
_id = ""
_href = ""
item[] =
(TenantServiceListInfo){
serviceListId =
(ServiceListID){
ownerId = "system"
serviceListName = "busfeaturepack"
}
tenantId = "demo"
totalLicenses = 1
},
}
But this still sets the xsi:type to ns0:ArrayOf_tns1_TenantServiceListInfo
Is there some way to override this xsi:type overriding behaviour in Suds?
_______________________________________________
suds mailing list
suds(a)lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/suds