I have some simple code to call a soap service (not public, sorry)
that should return a complex type "ArrayOfstring". This works in any
perl client, but no workable python client. I'm assuming that python
clients cannot accept return codes of complex (dict or list) type?
The wsdl is too long and unfriendly to generate, describe or post --
one of the most severe problems with SOAP imho. But you can clearly
see the response contains the correct xml and both entries in the
ArrayOfstring, but python does not get a list, only a string.
Code:
from suds.client import Client
url = 'http://localhost/wsdl/assets.wsdl'
client = Client(url)
print client
result = client.service.get_pools_by_availabilityzone('dev1')
print client.last_received()
print result
Result:
Python 2.4.3 (#1, May 5 2011, 16:39:10)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Suds (
https://fedorahosted.org/suds/ ) version: 0.3.9 GA build: R659-20100219
Service ( assetInventory ) tns="http://localhost/assets/Assets"
Prefixes (1)
ns0 = "http://localhost/assets/Assets"
Ports (1):
(assetInventorySoap)
Methods (2):
get_computeunits_free_by_pool(xs:string pool, )
get_pools_by_availabilityzone(xs:string availabilityzone, )
Types (1):
ArrayOfstring
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<get_pools_by_availabilityzoneResponse
xmlns="http://localhost/assets/Assets">
<s-gensym3
xsi:type="xsd:string">pool2-xen-dev1</s-gensym3>
<s-gensym5
xsi:type="xsd:string">pool1-xen-dev1</s-gensym5>
</get_pools_by_availabilityzoneResponse>
</soap:Body>
</soap:Envelope>
pool1
In perl the result is:
VAR1 => (
"pool1",
"pool2",
)