Python-zeep: Cannot send array of string in parameter

Created on 5 Sep 2017  路  1Comment  路  Source: mvantellingen/python-zeep

Hello,

I have this definition for a property :
<element name="attributes" type="impl:ArrayOfString"/>

However when I do :
valuesToBeSetted = ['customer', contactId, 'summary', summaryValue, 'description', descriptionValue ]

Then

client.service.doSelect(sid=sidR, objectType="nr", whereClause="name='awq'", maxRows=10, attributes=valuesToBeSetted)

it doesn't work.

How can I format elements to request the webservice ?

Thanks,

Most helpful comment

You need to use xsd types to populate array of string http://docs.python-zeep.org/en/master/datastructures.html

you can also find some examples in tests i guess in file https://github.com/mvantellingen/python-zeep/blob/master/tests/test_wsdl_arrays.py

ArrayOfString = schema.get_type('ns0:ArrayOfString')
print(ArrayOfString.__dict__)

value = ArrayOfString(['item', 'and', 'even', 'more', 'items'])

like above, get you xsd type from schema and populate against it.

>All comments

You need to use xsd types to populate array of string http://docs.python-zeep.org/en/master/datastructures.html

you can also find some examples in tests i guess in file https://github.com/mvantellingen/python-zeep/blob/master/tests/test_wsdl_arrays.py

ArrayOfString = schema.get_type('ns0:ArrayOfString')
print(ArrayOfString.__dict__)

value = ArrayOfString(['item', 'and', 'even', 'more', 'items'])

like above, get you xsd type from schema and populate against it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eagle-r picture eagle-r  路  6Comments

ghost picture ghost  路  6Comments

grguthrie picture grguthrie  路  4Comments

dhinchakdhoom picture dhinchakdhoom  路  4Comments

ZeWaren picture ZeWaren  路  3Comments