[Fedora-suds-list] Checking for the existence of elements in a response

Rob D robzyb at gmail.com
Sun Sep 12 09:21:34 UTC 2010


Hey, a big thanks to Jeff for helping me figure out how to use the 
Doctor :) It was much appreciated.

I currently have a bit of a problem, though. I have looked through the 
documentation and can't seem to find out what object/ client.service/ 
returns. This is my code:

    result =
    client.service.DoSomethingIncrediblyInteresting(WithADiscoStick)
    info =  result.*FirstField*.SomeTable.SomeData.somethingorother.DooDah

The thing is that sometimes *FirstField *doesnt exist which causes my 
Python program to quit rather angrily. Is there a check I can do on 
result, FirstField, and so on, to check of the children I'm about to 
grab info from actually exist?

Thanks,
Rob.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/suds/attachments/20100912/e9cff7e5/attachment.html 


More information about the suds mailing list