Convert suds objet in a python dict

743 Views Asked by At

I 'm using the suds library to consume a SOAP Api service. The data receiving is a suds object. I need convert from suds object to python dict.

According the documentation the way to do this is

from suds.client import Client

# Code to obtain your suds_object here...

required_dict = Client.dict(suds_object)

But not work. The console show me this:

{'root': <suds.sudsobject.root object at 0x7fafdf98c700>}

If i add a print with type the result is a dict but in fact i don't get a dict

data...
1

There are 1 best solutions below

0
Charlie Heitzig On

Try the function at the very end of this link: Serializing a suds object in python

Addresses both recursive suds objects, but also suds.sax.text.Text