xmlrpc Server

Andrew ajwms at visto.com
Mon Jun 4 09:04:34 EDT 2001


Doug Fort <dougfort at downright.com> wrote in message news:<3b1a674e$1_1 at news5.uncensored-news.com>...
> Andrew wrote:
> <snip>
> >
> > 
> >     def add(self, method, params):
> >         self.x = self.x + int(params[0])
> >         return "Sum = %s" % str(self.x)
> > 
> </snip>
> 
> I believe the add method should have the prototype 'def add(self, params)'. 
>  I don't think params[0] contains what you think it cpontains.
> 

Doug:

I tried changing 'def add(self, method, params)' to what you
suggested; unfortunately that didn't work.  In the 'call' method, I
had to change 'return server_method(method,params)' to 'return
server_method(method)' and it still doesn't keep a running total.

It looks like to me that the TestRequestHandler object is being
created and destroyed whenever someone requests/connects to the xmlrpc
server.

So... How in the world do I keep a persistent object as the request
handler?  For example, what if I wanted to use xmlrpc as a front-end
to a db; I would want the connection to the db to be persistent so I
wouldn't incur a speed penalty for connecting/disconnecting whenever
the request handler was called.

Any suggestions??  

Please???

TIA,

Andrew Williams



More information about the Python-list mailing list