[Fedora-suds-list] How to create arrayTypes in suds?

Jeff Ortel jortel at redhat.com
Fri Mar 13 12:35:18 UTC 2009


Hey David,

The rpc/encoded (section 5 encoded) arrays are defined as sequence of uncounded <xs:any/>. 
  So, after you create the array, you need to add an attribute to the sudsobject (with is 
the any) with the value of [].

Here's an example: http://svn.fedorahosted.org/svn/suds/trunk/tests/axis1.py

See below:

-jeff

David Bunch wrote:
> Hi I have a question about ArrayTypes.
> I have a webservice function that takes an ArrayOfPoints, Which is an 
> ArrayType that holds Point objects.
> Now, I can create the individual Point objects, but how do I create an 
> ArrayOfPoints and add points to it?  I tried this:
> 
> ArrayOfPoints = myClient.factory.create('ArrayOfPoints')
> 
> but then, how do I add points to it?  List operations don't seem to 
> work.  And when I do this:
> 
> ArrayOfPoints = [Point1, Point2, Point3]
> myClient.service.calculateCenter(ArrayOfPoints)

Try:

 >
 > ArrayOfPoints.items = [Point1, Point2, Point3]
 >

The "items" is arbitrarily named as it represents the <xs:any/> part of the array definition.

> 
> I get a fault error saying that ArrayOfPoints could not be serialized.
> 
> Any help/insight on this would be much appreciated.
> 
> Sincerely,
> -David
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> fedora-suds-list mailing list
> fedora-suds-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-suds-list




More information about the fedora-suds-list mailing list