[Fedora-suds-list] soapenc:array is being substituted

Jason McKellar jason at deadtreepages.com
Wed Mar 31 19:07:45 UTC 2010


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?


More information about the suds mailing list