I am in the same case, with WSX / WS encoded style and a method containing a soap array. a print request = client.factory.create('Request') (where request = client.factory.create('Request') ) gives:
(Request){ requestid = None option = (ArrayOfOption){ _arrayType = "" _offset = "" _id = "" _href = "" _arrayType = "" } }
The solution given by Jacques (1request.option.append (option1) 1) does not work, because it ends with the error message ArrayOfOption instance has no attribute append .
The solution given by mcauth is as follows:
array = client.factory.create('ArrayOfOption') array.item = [option1, option2, option3, option4, option5, option6] request.option=array
It works like this because the arrayType attribute is not displayed as a result of the SOAP message:
<option xsi:type="ns3:ArrayOfOption">
The best solution I found is also the simplest:
request.option = [option1, option2, option3, option4, option5, option6]
It ends with a good SOAP message:
<option xsi:type="ns0:ArrayOfOption" ns3:arrayType="ns0:Option[6]">
as expected on the server side of WS.
llemeur
source share