[Fedora-suds-list] Types not converting from a dict?
Jeff Ortel
jortel at redhat.com
Fri Mar 26 22:06:34 UTC 2010
On 03/26/2010 04:03 PM, Joshua J. Kugler wrote:
> WSDL file:
> https://adwords.google.com/api/adwords/cm/v200909/CampaignService?wsdl
>
> This code:
>
> #ga_month_start/end are strings
> #ga.Campaign is my 'client' object, dynamically finds the method, etc.
> stats = ga.Campaign.client.get({'ids':[ga_campaign.id],
> 'statsSelector':{
> 'dateRange':{
> 'min':ga_month_start,
> 'max':ga_month_end
> }
> }
> })
>
> Throws this error:
> File "build/bdist.linux-i686/egg/suds/client.py", line 539, in
> __call__
> File "build/bdist.linux-i686/egg/suds/client.py", line 592, in invoke
> File "build/bdist.linux-i686/egg/suds/bindings/binding.py", line 118,
> in get_message
> File "build/bdist.linux-i686/egg/suds/bindings/document.py", line 63,
> in bodycontent
> File "build/bdist.linux-i686/egg/suds/bindings/document.py", line 105,
> in mkparam
> File "build/bdist.linux-i686/egg/suds/bindings/binding.py", line 260,
> in mkparam
> File "build/bdist.linux-i686/egg/suds/mx/core.py", line 62, in process
> File "build/bdist.linux-i686/egg/suds/mx/core.py", line 75, in append
> File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 102, in
> append
> File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 243, in
> append
> File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 182, in
> append
> File "build/bdist.linux-i686/egg/suds/mx/core.py", line 75, in append
> File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 102, in
> append
> File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 243, in
> append
> File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 182, in
> append
> File "build/bdist.linux-i686/egg/suds/mx/core.py", line 74, in append
> File "build/bdist.linux-i686/egg/suds/mx/literal.py", line 87, in
> start
> suds.TypeNotFound: Type not found: 'max'
>
> This code:
> selector = ga.Campaign.client.factory.create('CampaignSelector')
> selector.ids = [ga_campaign.id]
> selector.statsSelector.dateRange.min = ga_month_start
> selector.statsSelector.dateRange.max = ga_month_end
> campaign_stats = ga.Campaign.client.get(selector)
>
> Works fine, and produces the following selector, which is accepted by
> the adwords API.
>
> (CampaignSelector){
> ids[] =
> 18657145,
> campaignStatuses[] =<empty>
> statsSelector =
> (StatsSelector){
> dateRange =
> (DateRange){
> min = "20100201"
> max = "20100228"
> }
> StatsSelector.Type = None
> }
> paging =
> (Paging){
> startIndex = None
> numberResults = None
> }
> }
>
> I was sure I had this working before...Am I doing something wrong that I
> don't see (which is what I suspect), or is Suds doing something wrong
> with the type here?
Hmm.. At first glance it looks right. I'll give it a try.
>
> By the way, this is suds/trunk revision 665.
>
> j
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5126 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.fedoraproject.org/pipermail/suds/attachments/20100326/5f6eb414/attachment.bin
More information about the suds
mailing list