diff options
-rw-r--r-- | suds/__init__.py | 2 | ||||
-rw-r--r-- | suds/bindings/binding.py | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/suds/__init__.py b/suds/__init__.py index b403d43..12eed79 100644 --- a/suds/__init__.py +++ b/suds/__init__.py @@ -27,7 +27,7 @@ import sys # __version__ = '0.4' -__build__="(beta) R674-20100503" +__build__="(beta) R675-20100505" # # Exceptions 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 |