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

Joshua J. Kugler joshua at eeinternet.com
Thu Mar 25 21:16:33 UTC 2010


On Thursday 25 March 2010, Joshua J. Kugler elucidated thus:
> 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>

Jeff Ortel helped me with this on IRC (THANK YOU!) and we ended up 
figuring out this gave me the desired behavior:

selector = client.factory.create('CampaignSelector')
selector.statsSelector = ' '
print client.get(selector)

Yes, you read right: that is setting statsSelector to a space.  It then 
sends this to google:

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

And google is perfectly happy with that: it returns all campaigns, all 
statistics.

Thanks again Jeff for all your help!

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