newbi question on python rpc server, how it works?

Jeff McNeil jeff at jmcneil.net
Wed Mar 28 16:04:48 EDT 2007


I've built a bit of an account provisioning/support framework here based on
SimpleXMLRPCServer (which is the one bundled w/ Python).  Take a look at
http://docs.python.org/lib/module-SimpleXMLRPCServer.html as it also
includes a bit of a code example.  It seems to work fine for my needs in
that I only server between 5 - 6 requests a minute.  All XML-RPC calls
translate into one or more LDAP calls. I've about ten clients connecting at
random times.

I've set it up to run on localhost:8080 and then I use
Apache+mod_ssl+htaccess+mod_proxy to provide some security.  Direct requests
are sent to https://user:password@rpc-server/RPC2 and proxied internally
back to the XMLRPC server.

Twisted might be an easier option though as you'll not have to deal with all
of the daemonization details.

Also, check out http://www.xmlrpc.com for protocol details.

Jeff

On 3/28/07, Larry Bates <lbates at websafe.com> wrote:
>
> krishnakant Mane wrote:
> > hello,
> > searched a lot of places including google search but can't find
> > answers to python-rpc.  I am also very new to rpc.  I am very clear
> > about its meaning and where it is to be used, but not about how it is
> > done.
> > I have a need where I need to create a layer of business logic that
> > will connect to mysql database at one end and a wxpython based thin
> > client at the other end.
> > can some one give me basic idea as to how I can use simple xml rpc
> > server class of python and build an xml rpc server and then a client
> > which I can embed in my wxpython based thin client?
> > as I said I am not aware of how xml rpc works in details.
> > I want to creat the wxpython client app in such a way that it only
> > does the work of validation and display and only sending the data as
> > is to the xml rpc server for logic and then xml rpc server will
> > inturn talk to mysql.
> > my business logic consists of many classes which I want to put in a
> > package directory with __init__.py and all the other modules.
> > do I need to create all of them as xml rpc server instances or can I
> > use them into one single xml rpc server class?
> > at the other end I am not really understanding how the xml rpc client
> > can be used to get data in to my wx based gui?
> > for example I want to fill up a list box with data that came from the
> > rpc server to the client and then some how looping through the
> > elements sent over and putting into a list.
> >
> > regards.
> > Krishnakant
>
> I'm no expert, but maybe I can get you started.
>
> If you understand how a SQL database works you can extend that knowledge
> to RPC.  You make queries to the RPC server and it returns responses.
> The format of the queries/responses is "normally" XML, but I'm pretty
> sure you could invent your own if you wanted to (probably a bad idea).
> Basically you define an API (like SQL queries define their API) that is
> used by the clients to make requests, update information, retrieve
> information, etc.
>
> You probably should take a look at Twisted module.  It does XMLRPC with
> just a few lines of code and also would scale well as you have many
> users talking to the server.  Download Twisted and take a look.  You
> might also want to pick up a copy of "Twisted Network Programming
> Essentials":
>
> http://www.oreilly.com/catalog/twistedadn/
>
> I'll bet it will be worth the purchase price if you choose to go this
> direction.
>
> -Larry Bates
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070328/425c3d02/attachment.html>


More information about the Python-list mailing list