[Twisted-Python] XML-RPC server

Remi Cool mailinglists at smartology.nl
Fri May 26 06:51:43 MDT 2006


Kelly Vincent wrote:

>I am quite new to Twisted and I'm having some trouble
>getting my XML-RPC server to do exactly what I want. 
>
>We have a relatively simple goal: create an XML-RPC
>server that will accept a request for a score, call a
>function that computes that score, and then return the
>score. The two catches are that 1. the client is
>actually a .NET web server rather than a Twisted
>client, and 2. we could have thousands of requests
>come in relatively simultaneously (though more likely
>not greater than a few hundred), likely with lots of
>downtime between these periods of high activity. We
>are planning to create a look-up table to deal with
>some of the more common calculations, but I still need
>to be able to run the other calculations
>non-sequentially. I know that using a Deferred object
>is the normal solution, but I'm not entirely sure if
>it could work here without threads. I read somewhere 
>that when the function call is not from another 
>Twisted application, it's not possible to use the 
>Deferred object. Is this actually the case? Or would 
>it work in my situation since all of the "deferring" 
>would be occurring within the server itself? My 
>current solution involves using threads and a Deferred
>
>  
>
To my knowledge, a client has nothing to do with twisted internals like
deferreds.

For example I use a twisted xmlrpc server that get's it's requests from
a php script via apache.
You also could test your code with a simple python xmlrpc client like:

from xmlrpclib import ServerProxy

server = ServerProxy("http://yourserver:port")

print server

try:
    print server.your.method(attr)
except Exception, v:
    print "ERROR", v

- Remi -




More information about the Twisted-Python mailing list