[Fedora-suds-list] Array confusion
Uri Shkolnik
urishk at yahoo.com
Thu Jul 16 21:29:25 UTC 2009
Jeff,
Thanks for your help, it works.
The sequence of -
1) Create the father type (which contains an array) using .client.factory.create()
2) Create derived (array) type using .client.factory.create()
3) Populate the array item 4) Add the array as a *tuple* using XYZ.items()
Example:
searchRequest = self.client.factory.create('searchRequest') # top item
itinerary0 = self.client.factory.create('itinerary') # derived item
itinerary0.departurePoint = locationPoint0
itinerary0.arrivalPoint = locationPoint1
itinerary0.dateTimeDetails = dateTimeDetails
searchRequest.itineraryArr.items = [itinerary0] # Add derived to it's father, using .items, as a tuple ....
works like a charm.
Thanks again,
Uri
--- On Thu, 7/16/09, William R. Dickson <billd-lists at forest.net> wrote:
> From: William R. Dickson <billd-lists at forest.net>
> Subject: [Fedora-suds-list] Array confusion
> To: fedora-suds-list at redhat.com
> Date: Thursday, July 16, 2009, 10:46 PM
> I apologize again for what is I'm
> sure a very basic question.
>
> A service (is that the right term?) is listed as wanting
> the following:
>
> createEmailClient(ns1:ArrayOfInt offerIDs,
> xs:string emailDomain, xs:string webmailHostname, )
>
> This'll be my first attempt at a complex type, I guess.
> Although it's asking for an array, there's only one value. I
> tried the following based on some google searching:
>
> offer_array =
> self.client.factory.create('ns1:ArrayOfInt')
> offer_array.offer = '9999'
> print offer_array
>
> self.client.service.createEmailClient(offerIDs=offer_array,
> emailDomain=domain, webmailHostname=hostname)
>
> This results in the following:
>
> (ArrayOfInt){
> _arrayType = ""
> _offset = ""
> _id = ""
> _href = ""
> offer = "9999"
> }
>
> ...followed by the following error:
>
> File "/Users/wrd/Scripts/mailthing3/Modules/ev1.py",
> line 57, in Create_Client
>
> self.client.service.createEmailClient(offerIDs=offer_array,
> emailDomain=domain, webmailHostname=hostname)
> File
> "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 240,
> in __call__
> File
> "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 379,
> in call
> File
> "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 240,
> in __call__
> File
> "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 422,
> in call
> File
> "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 480,
> in invoke
> File
> "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 511,
> in send
> File
> "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 562,
> in failed
> File
> "build/bdist.macosx-10.5-i386/egg/suds/bindings/binding.py",
> line 227, in get_fault
> suds.WebFault: Server raised fault:
> 'java.lang.IllegalArgumentException: argument type
> mismatch'
>
> I assume I'm constructing the array incorrectly. Any
> suggestions would be much appreciated.
>
> Thanks,
>
> -Bill
>
> _______________________________________________
> 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