[Soap-Python] Using arrays with SUDS

azurIt azurit at pobox.sk
Tue Sep 27 14:24:01 CEST 2011


Hi,

i'm having problems with simple arrays and SUDS client. I have a function with 'array of string' input parameter:

@srpc(Array(String), _returns=String)
def testf(items):
  ...

i'm, unfortunately, not able to call it with SUDS. I tried to send Python array (i prefer to use it like this):

client.service.testf(["ddd", "bbb"])

XML:
<ns1:Body>
   <ns0:testf>
      <ns0:items>ddd</ns0:items>
      <ns0:items>bbb</ns0:items>
   </ns0:testf>
</ns1:Body>

error:
suds.WebFault: Server raised fault: '<string>:1:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element '{testt}items': This element is not expected.'


I tried to create array from SUDS factory:

items = client.factory.create("items")
# also tried items["0"], items.first and so on
items.item = "ddd"

error:
suds.TypeNotFound: Type not found: 'item'

Any ideas ?

azur


More information about the Soap mailing list