Search code examples
pythonwsdlsuds

suds and choice tag


how to generate request to method with "choice" arguments?

part of wsdl at http://127.0.0.1/service?wsdl:

<xs:complexType name="ByA">
<xs:sequence>
...
</xs:sequence>
</xs:complexType>
<xs:complexType name="ByB">
<xs:sequence>
...
</xs:sequence>
</xs:complexType>

<xs:complexType name="GetMethodRequest">
<xs:choice>
<xs:element name="byA" type="s0:ByA" />
<xs:element name="byB" type="s0:ByB" />
</xs:choice>
</xs:complexType>

when I do

from suds.client import Client
client = Client("http://127.0.0.1/service?wsdl")
print client

I see

GetMethod()

without any arguments.

how I can call GetMethod with byA or with byB?


Solution

  • It's a known bug in suds https://fedorahosted.org/suds/ticket/342