43 def __init__(self): |
44 def __init__(self): |
44 xmlrpc.XMLRPC.__init__(self) |
45 xmlrpc.XMLRPC.__init__(self) |
45 TwistedInterface.__init__(self) |
46 TwistedInterface.__init__(self) |
46 |
47 |
47 def lookupProcedure(self, procedurePath): |
48 def lookupProcedure(self, procedurePath): |
48 logging.debug("lookupProcedure('%s')"%procedurePath) |
|
49 if procedurePath not in self.listProcedures(): |
49 if procedurePath not in self.listProcedures(): |
50 raise xmlrpc.NoSuchFunction(self.NOT_FOUND, |
50 raise xmlrpc.NoSuchFunction(self.NOT_FOUND, |
51 "procedure %s not found" % procedurePath) |
51 "procedure %s not found" % procedurePath) |
52 try: |
52 try: |
53 return getattr(self,procedurePath) |
53 return getattr(self,procedurePath) |
54 except KeyError: |
54 except KeyError: |
55 raise xmlrpc.NoSuchFunction(self.NOT_FOUND, |
55 raise xmlrpc.NoSuchFunction(self.NOT_FOUND, |
56 "procedure %s not found" % procedurePath) |
56 "procedure %s not found" % procedurePath) |
|
57 |
|
58 def _ebRender(self, failure): |
|
59 if isinstance(failure.value, InterfaceException): |
|
60 return xmlrpc.Fault(failure.value.code, failure.value.msg) |
|
61 if isinstance(failure.value, ValidateException): |
|
62 return xmlrpc.Fault(failure.value.code, failure.value.msg) |
|
63 return xmlrpc.XMLRPC._ebRender(self, failure) |
|
64 |
57 |
65 |
58 class SOAPInterface(TwistedInterface,soap.SOAPPublisher): |
66 class SOAPInterface(TwistedInterface,soap.SOAPPublisher): |
59 def __init__(self): |
67 def __init__(self): |
60 soap.SOAPPublisher.__init__(self) |
68 soap.SOAPPublisher.__init__(self) |
61 TwistedInterface.__init__(self) |
69 TwistedInterface.__init__(self) |