|
Update: I misremembered what version of SOAPpy I had installed. Actually the bug was first listed here as a bug for SOAPpy 0.11.1, but that's wrong. It's SOAPpy 0.10.1 that has the bug. SOAPpy 0.11.1 is working fine. But if you want to upgrade to SOAPpy 0.11.1, you need to use PyDS from current CVS, as older versions are not compatible with SOAPpy 0.11! The next release will require SOAPpy 0.11.1 (and fpconst 0.6.0, as that is needed by SOAPpy 0.11.1).
If you call a function on a remote webservice and that function throws an exception, and if that exception is of type SOAPpy.Types.faultType, the client code automatically should throw a corresponding exception. This doesn't work, because the following code:
p, attrs = parseSOAPRPC(r, attrs = 1)
try:
throw_struct = self.throw_faults and \
isinstance (p, faultType)
except:
throw_struct = 0
if throw_struct:
print p
raise p
around line 297 in Client.py does check wether the result is an instance of class faultType. But Client.py is missing the necessary import statement and so doesn't know about faultType. As a result you get the faultType instance passed along as call result instead.
To fix it, just go to the head of Client.py and change it as follows:
from Errors import *
from Config import Config
from Parser import parseSOAPRPC
from SOAPBuilder import buildSOAP
from Utilities import *
from Types import *
That's all, now SOAPpy.Client should throw exceptions just fine. The correct way to don't get exceptions thrown is to pass an optional argument throw_faults=0 to the creation of your SOAPProxy instance.
|