views:

117

answers:

1

I'm trying to raise an exception on the Server Side of an SimpleXMLRPCServer; however, all attempts get a "Fault 1" exception on the client side.

RPC_Server.AbortTest() File "C:\Python25\lib\xmlrpclib.py", line 1147, in call return self.send(self.__name, args) File "C:\Python25\lib\xmlrpclib.py", line 1437, in __request verbose=self.__verbose File "C:\Python25\lib\xmlrpclib.py", line 1201, in request return self._parse_response(h.getfile(), sock) File "C:\Python25\lib\xmlrpclib.py", line 1340, in _parse_response return u.close() File "C:\Python25\lib\xmlrpclib.py", line 787, in close raise Fault(self._stack[0]) xmlrpclib.Fault: :Test Aborted by a RPC request">

+1  A: 

Yes, this is what happens when you raise an exception on the server side. Are you expecting the SimpleXMLRPCServer to return the exception to the client?

You can only use objects that can be marshalled through XML. This includes

  • boolean : The True and False constants
  • integers : Pass in directly
  • floating-point numbers : Pass in directly
  • strings : Pass in directly
  • arrays : Any Python sequence type containing conformable elements. Arrays are returned as lists
  • structures : A Python dictionary. Keys must be strings, values may be any conformable type. Objects of user-defined classes can be passed in; only their __dict__ attribute is transmitted.
  • dates : in seconds since the epoch (pass in an instance of the DateTime class) or a datetime.datetime instance.
  • binary data : pass in an instance of the Binary wrapper class
JimB