[Fedora-suds-list] Forcing empty objects to send

Joshua J. Kugler joshua at eeinternet.com
Thu Mar 25 19:59:30 UTC 2010


Is there a way to force suds to send an empty object?

The Google adwords API requires an empty campaign selector for a "get 
everything" call (and an empty statsSelector object in that selector 
for "all stats), but if I use the factory to create a selector and set 
no values:

(CampaignSelector){
   ids[] = <empty>
   campaignStatuses[] = <empty>
   statsSelector =
      (StatsSelector){
         dateRange =
            (DateRange){
               min = None
               max = None
            }
         StatsSelector.Type = None
      }
   paging =
      (Paging){
         startIndex = None
         numberResults = None
      }
 }

suds sends

   <ns1:Body>
      <ns0:get/>
   </ns1:Body>

when I pass in this "unmodified" selector.

I would like suds to send something like (not 100% sure of all the 
namespaces, etc):

      <ns0:get>
         <ns0:selector>
            <ns0:statsSelector/>
         </ns0:selector>
      </ns0:get>

Is there any way to do this?

Thanks!

j

-- 
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0x73B13B6A


More information about the suds mailing list