Hey Bill -
On 11/18/2009 08:18 PM, Bill Watts wrote:
Hi,
I have been using suds for about a week now, and I am very impressed
with the capabilities and ease of use of this API. Outstanding work!
Thanks :)
I am using suds to work with a fairly complex WSDL, and have almost
everything working, with the exception of the arrayType encoding. I
downloaded and installed the beta of 0.3.8 because I saw a posting
stating that the beta supports setting the arrayType. After spending a
couple of hours grepping through the code and trying different things, I
am still unable to determine how to set the arrayType.
I can make successful requests using SoapUi, and the section I am trying
to generate looks like this:
<item xsi:type="bus:parameterValue">
<name xsi:type="xsd:string">owner_id</name>
<value xsi:type="soapenc:Array"
*soapenc:arrayType="bus:parmValueItem[]"*>
<item xsi:type="bus:simpleParmValueItem">
<use xsi:type="xsd:string">321</use>
</item>
</value>
</item>
The API is generating:
<item xsi:type="ns0:parameterValue">
<ns0:name xsi:type="ns2:string">owner_id</ns0:name>
<ns0:value xsi:type="SOAP-ENC:Array">
<item xsi:type="ns0:simpleParmValueItem">
<ns0:inclusive xsi:type="ns2:boolean"/>
<ns0:display xsi:type="ns2:string"/>
<ns0:use xsi:type="ns2:string">321</ns0:use>
</item>
</ns0:value>
</item>
The enhancements discussed in 0.3.8 are not yet included in the documentation (looks like
I need to get it updated). What you're doing here is correct according to the
documentation but does not take advantage of the 0.3.8 enhancements. Based on your code
and without seeing the WSDL, I'd suggest (think) you want to do:
def createParameter(client, name, value):
item = client.factory.create('parameterValue')
item.name = name
spvi = client.factory.create('simpleParmValueItem')
spvi.use = value
item.value = [spvi]
In the 0.3.8 rpc/encoded enhancement, you no longer want (or need to) create the
SOAP-ENC:Array.
You can also join me on IRC FreeNode #suds and we can discuss further.
Here is my code:
def createParameter(client, name, value):
item = client.factory.create('parameterValue')
item.name = name
item.value = client.factory.create('SOAP-ENC:Array')
spvi = client.factory.create('simpleParmValueItem')
spvi.use = value
item.value.item = [spvi]
The WSDL is almost 1MB, so I won’t include it here. Any help is very
much appreciated.
Thanks,
-Bill
_______________________________________________
fedora-suds-list mailing list
fedora-suds-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/fedora-suds-list