Howdy,
I'm trying trying to figure out a way to pass optional arguments to a Soap Method, but don't get it working ...
Assume a wsdl.
<s:element name="DoIt">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="arg1" type="tns:MyType"/>
<s:element minOccurs="0" maxOccurs="1" name="arg2" type="tns:MyType"/>
</s:sequence>
</s:complexType>
</s:element>
Now I would like to execute the following method calls:
Do(arg1=abc)
How should I call the "Call Soap Method" in sudsLibrary to make this work?
I have tried all kinds of variations of passing the arguments but it the generated SOAP message is always wrong e.g.
a) passing the argument names in the call method e.g.
Call Soap Method DoIt arg1 abc arg2 def
Call Soap Method DoIt arg1=abc arg2=def
--> but this does not work, the arguments are used a positional when generating the SOAP e.g.
<ns0:DoIt>
<ns0:arg1>arg1</ns0:arg1>
<ns0:arg2>abc</ns0:arg2>
</ns0:DoIt>
and
<ns0:DoIt>
<ns0:arg1>arg1=abc</ns0:arg1>
<ns0:arg2>arg2=def</ns0:arg2>
</ns0:DoIt>
b) passing WSDL object as argument
${a}= Create Wsdl Object DoIt arg1 abc arg2 def
${resp}= Call Soap Method DoIt ${a}
--> but this does not work, the WSDL object is inserted into the first argument e.g.
<ns0:DoIt>
<ns0:arg1>
<ns0:arg1>abc</ns0:arg1>
<ns0:arg2>def</ns0:arg2>
</ns0:arg1>
<ns0:arg2>arg2=def</ns0:arg2>
</ns0:DoIt>
c) Calling the method with empty arguments e.g.
Call Soap Method DoIt abc ${EMPTY}
Call Soap Method DoIt ${EMPTY} def
--> but this does not work, the optional arguments are still in the request without values e.g.
<ns0:DoIt>
<ns0:arg1>abc</ns0:arg1>
<ns0:arg2/>
</ns0:DoIt>
I'm using suds (0.4) and sudslibrary (0.8)....