I connect to the SUDS client with a SOAP server whose wsdl contains many enumerations, such as:
</simpleType>
<simpleType name="FOOENUMERATION">
<restriction base="xsd:string">
<enumeration value="ALPHA">
<enumeration value="BETA"/>
<enumeration value="GAMMA"/>
<enumeration value="DELTA"/>
</restriction>
</simpleType>
In my client, I get sequences that contain elements of these various enumeration types. My need is, given the member variable, I need to know all the possible values of the enumeration. Basically I need a function that takes an instance of one of these enumerations and returns a list of strings that are all possible values.
When I have an instance, do:
print type(foo.enumInstance)
I get:
<class 'suds.sax.text.Text'>
I'm not sure how to get the name simpleType from this, and then get the possible values due to WSDL parsing.
:. simpleType, , , , (x) suds.sax.text.Text
for l in client.factory.create('FOOENUMERATION'):
print l[0]