Yeah, that code was out of memory and I didn't test it, my apologies. Need to actually return a value from _dispatch.
class MyCalls(object): def _dispatch(self, method, args): try: return getattr(self, method)(*args) except: handle_logging() server = SimpleXMLRPCServer(("localhost", 8000)) server.register_instance(MyCalls()) server.serve_forever() -Jeff On 9/27 On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Sep 27, 3:55 pm, "Jeff McNeil" <[EMAIL PROTECTED]> wrote: > > Instead of register_function, use register_instance and provide a > > _dispatch method in that instance that handles your exception logging. > > > > Pseudo: > > > > class MyCalls(object): > > def _dispatch(self, method, args): > > try: > > self.getattr(self, method)(*args) > > except: > > handle_logging() > > > > server = SimpleXMLRPCServer(("localhost", 8000)) > > server.register_instance(MyCalls()) > > server.serve_forever() > > > > There might be an easier way... but this works for me. > > I wonder if there is something wrong with that. I get this error on > calling ever method: > > Fault 1: 'exceptions.TypeError:cannot marshal None unless allow_none > is enabled' but I can't see anywhere None would be coming from. > > -Greg > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list