Using xmlrpclib and SimpleXMLRPCServer makes usage of xmlrpc in python a piece of cake. But the limited C-style interfaces of xmlrpc are inherently stateless. To circumvene this, one usually expose some sort of session initialization that returns a unique id to associate subsequent calls to the interface with that same session.This is just another bit of XML-RPC code that might be useful to look at for the metacharting project. One of the things I need to do to fill in some of the gaps in the metacharting project for my dissertation is to maintain state for objects created via the XML-RPC server.
This recipe automates the creation and lookup of those keys by decorating the xmlrpc servers methods so that incoming calls arguments are automatically replaced by their respective objects.
Additionally the management of session state usually requires timeouts. These too are part of the
An extension to this recipe would be to use the generic _dispatch method and directly call the passed function name on the passed object. Thus the xmlrpc Server is extremely primitive, while OO-style programming can be achieved at least at server-side without any effort.