Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to raise Suds.WebFault from python code?

I am trying to raise a Suds.WebFault from python code. The __init__ method\constructor takes three arguments __init__(self, fault, document). The fault has fault.faultcode and fault.detail members\attributes\properties. I could not find out what class fault belongs to no matte what I tried. How do I raise Suds.WebFault type exception from python code?

Thanks in advance.

like image 386
neel Avatar asked Apr 13 '11 15:04

neel


1 Answers

Not sure what exactly you are asking but you can throw a web fault using:

import suds

try:
    client.service.Method(parameter)
except suds.WebFault, e:
    print e
like image 116
chrisg Avatar answered Sep 22 '22 09:09

chrisg