Environment:
The WSDL (server) I work with, have the following schema sub-sections (I tried to w
I'm in the same case, with a RPC/encoded style WS and a method that contains a soap array. a print 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, as it ends with an error message ArrayOfOption instance has no attribute append
.
The solution given by mcauth looks like this:
array = client.factory.create('ArrayOfOption')
array.item = [option1, option2, option3, option4, option5, option6]
request.option=array
It works so so, as the resulting SOAP message shows no arrayType
attribute:
The best solution I found is also the simplest:
request.option = [option1, option2, option3, option4, option5, option6]
It ends with a good SOAP message:
as expected by the server side WS.