programming with XML-RPC in Python

J.Jacob joost_jacob at hotmail.com
Thu Jul 25 09:03:19 EDT 2002


I put a new improved version at:
http://www.liacs.nl/~jjacob/swc/swc.zip


About this project:

Goal:
-----
Provide functions to turn a Python class into a server offering
selected methods from the class for remote usage via internet.  The
server can also have a quit method and methods for adding and
managing clients and for sending events to the clients in an
asynchronous way (without waiting for a return value).
This way processes written in any computer language and running on
any OS platform could work together.

Design goals:
-------------
* Only use modules in the default Python distributions and supply
everything else.  If possible stay backwards compatible with Python
version 1.5.2 until a higher Python version becomes the default at
most places.
* No modification of existing code necessary if you want to turn a
class into a server.

There is still a lot to do and to investigate:
----------------------------------------------
* Stopping a server remotely is done with a global module variable,
this is looking ugly.
* The asynchronous event sending is not really asynchronous: it also
uses XML-RPC and does a synchronous method call in a thread.
Ideally it should use UDP instead of TCP?  For this the server could
be equipped with a method that returns the location of an event
handler that accepts UDP events.
* The interface definition for servers is done with a simple list of
strings for the method names.  Maybe a class-interface mechanism
would be a better design here.
* XML-RPC is used for remote method calls, I have no idea if XML-RPC
is the best choice for this but it certainly was the easiest to
implement (other choices were CORBA [what a hairy #$£%!] and SOAP
[fluctuating standard problems]).
* A function or class method to log in to another computer with your
username and password (encrypted!) and moving a running server over
there and letting all clients know the new location (host,port).
* Better documentation.



More information about the Python-list mailing list