diff options
Diffstat (limited to 'suds/bindings/binding.py')
-rw-r--r-- | suds/bindings/binding.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/suds/bindings/binding.py b/suds/bindings/binding.py index 959c339..ef857df 100644 --- a/suds/bindings/binding.py +++ b/suds/bindings/binding.py @@ -145,6 +145,7 @@ class Binding: soapenv = replyroot.getChild('Envelope') soapenv.promotePrefixes() soapbody = soapenv.getChild('Body') + self.detect_fault(soapbody) soapbody = self.multiref.process(soapbody) nodes = self.replycontent(method, soapbody) rtypes = self.returned_types(method) @@ -162,6 +163,23 @@ class Binding: return (replyroot, result) return (replyroot, None) + def detect_fault(self, body): + """ + Detect I{hidden} soapenv:Fault element in the soap body. + @param body: The soap envelope body. + @type body: L{Element} + @raise WebFault: When found. + """ + fault = body.getChild('Fault', envns) + if fault is None: + return + unmarshaller = self.unmarshaller(False) + p = unmarshaller.process(fault) + if self.options().faults: + raise WebFault(p, fault) + return self + + def replylist(self, rt, nodes): """ Construct a I{list} reply. This mehod is called when it has been detected |