SQL Qeries via XMLRPC

Roger Binns rogerb at rogerbinns.com
Tue Aug 10 00:32:37 EDT 2004


Simon Wittber wrote:
> The problem is, I have a tiny little nag in my mind about the use of
> XMLRPC (and therefore HTTP) to implement this.
>
> Has anyone done this sort of thing before?
>
> Are there any problems with this strategy that I have not considered?

Using XML-RPC is a great way of exposing services and data.
You do however want the API exposed to be higher level
rather than lower level (for example retrieve an entire
record in one go rather than a field at a time).

Using XML-RPC does not prevent also adding other service
mechanisms such as SOAP, CORBA or whatever is flavour
of next year.  I would suggest looking at the Cookbook
to get a feel for it, and also to see the limitations.
For example XML-RPC doesn't support None and SOAP
can't handle empty dictionaries.

Note that using XML-RPC does not mean HTTP.  The most
common transport for XML-RPC is HTTP, but you can use
it over anything.  In one of my projects I use it over
SSH (using the Paramiko library to do the SSH part)

The existing standard Python library XML-RPC works
well, but has the limitation that it doesn't fully
support HTTP authentication and it uses one connection
per request.  The authentication issue can be solved
by making authentication part of your exposed APIs,
not the underlying XML-RPC transport.

The one connection per request will presumably be
solved in a future release of the Python library
and generally is not an issue on a LAN.

The great thing about using XML-RPC is the cross
language portability.  You can get bindings for any
language.  One of my projects was a web site with
the front end done in PHP (Smarty) and the backend
all being Python exposed via XML-RPC over HTTP.

Roger 





More information about the Python-list mailing list