SimpleXMLRPCServer question

flagg ianand0204 at gmail.com
Sat Jan 31 15:11:16 EST 2009


On Jan 30, 8:12 pm, rdmur... at bitdance.com wrote:
> Quoth flagg <ianand0... at gmail.com>:
>
> > I am working on a very basic xmlrpc server, which will expose certain
> > functions for administering BIND zone files.  The big problem I am
> > having is parsing the incoming xmlrpc request.  Basically part of the
> > xmlrpc request will help deterime which zone file is edited.    I have
> > been looking at the do_POST() method from SimpleXMLRPCDispatcher and
> > it seems like I could code something which overides that method,
> > however I am new to programming am at a loss, i might even be making
> > this tougher than it needs to be.   Is there a way to parse the
> > incoming xmlrpc request before the function it is calling is executed?
>
> Wouldn't you be overriding '_dispatch' on SimpleXMLRPCServer instead?
>
> It's been a while since I looked at XMLRPC, but why wouldn't you have
> a operation names, with the zone file to operate on as an argument?
> Then you'd just be defining your operations as methods on your
> SimpleXMLRPCServer, and they'd use the argument to determine which file
> to operate on.
>
> If that doesn't make sense, either I've forgotten how XMLRPC works,
> or you should explain your requirements a bit more.
>
> --RDM

Let me see if i can elaborate on the requirements.  I have 20+
different zone files.  I want the xmlrpc server to be able to
determine what zone file to open by looking at the incoming xml
request.  For example one of the functions I have now is to show a DNS
record (I am using dnspython for most of this work)

If i send an xmlrpc request that uses the 'showRecord' function with
params of 'oracle1.foo.bar.com'  I want to parse the "params" piece
and then instruct the xml-rpc server to open foo.bar.com.zone for
reading.  The reason why i was looking at do_Post() and _dispatch was
to attempt to read the incoming params and do exactly that.

Do you think there is an easier way of accomplishing this, than the
way I am going about it?



More information about the Python-list mailing list