Multiple XML-RPC calls over the same connection?
Diez B. Roggisch
deetsNOSPAM at web.de
Fri Oct 29 14:49:50 EDT 2004
Hi,
> The standard pattern for doing that is having an xmlrpc call
> that you supply username/password/other credentials to. It
> then responds with a pair of tokens. You then use them as
> part of the URL where usernames and passwords are usually
> used. For example:
>
> sp=xmlrpclib.ServerProxy("http://foo.example.com")
> c1,c2=sp.login("username", "password", "etc")
>
> sp=xmlrpclib.ServerProxy("http://%s:%s@foo.example.com" % (c1,c2))
> sp.DoSomething(1,2)
> sp.DoSomethingElse(3,4)
>
> This will work fine with the current client side xmlrpclib. If
> you server side is written in Python then you will need to make
> a derived request handler that grabs and verifies the authentication
> headers before calling the intended routines (except for the login
> function :-)
While I have to admit that it is a nice trick, its something I expect beeing
part of a IPC-standard - otherwise, it renders the standard short of beeing
useless.
There are alternatives out there, like corba, which allow for much better
implementations - in terms of ease of use from the api side as well as
performance and interoperability. Having to tweak a standard to make it
work in a certainly common pattern strikes me as awkward. Unfortunately, I
have to use xmlrpc myself as php corba support isn't too good - but I keep
it to a minimum, and its dead ugly...
--
Regards,
Diez B. Roggisch
More information about the Python-list
mailing list