View XMLRPC Requests/Responses?

vasudevram vasudevram at gmail.com
Mon Oct 15 17:54:36 CEST 2007


On Oct 15, 8:49 pm, vasudevram <vasudev... at gmail.com> wrote:
> On Oct 15, 8:10 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
>
> > xkenneth wrote:
> > > Hi,
>
> > >     I'm working on developing an XML-RPC interface from LabVIEW to
> > > python and I would really like to see how python is forming it's XML-
> > > RPC requests/responses. Is there any way I can force these to a log or
> > > print them to the screen? Thanks.
>
> > I've utilized the apache axis tcpmon for that, as proxy. See
>
> >http://docs.pushtotest.com/axisdocs/user-guide.html#tcpmon
>
> > Diez
>
> I haven't used apache axis tcpmon - so don't know how easy or
> difficult it is to use that approach - but if its non-trivial or
> awkward, there's another easy way - since the xmlrpc lib source is
> available - and it is, its part of the Python Standard library - just
> root around in the source and modify it to log to a file or to the
> screen. Will be pretty straightforward to do it. Its a hack, though, I
> know - because your changes would need to be carried around everywhere
> you want to use them (but then so does your code), and also because
> they would get clobbered when you upgraded to the next Python
> release.
>
> So a better way might be to inherit from an appropriate class of
> xmlrpclib client or server, use that class in your code instead, and
> modify the inherited class to log as needed, by getting hold of some
> output stream of the parent class - if it is exposed.
>
> <a href="http://www.dancingbison.com">Vasudev Ram</a>

I sort of had a need for this myself recently when writing some Python
XML-RPC code, but didn't do it because I could manage to debug my code
without it - but I remember noticing that my XML-RPC server was
logging the requests to stdout, by default (without any code by me to
do it). So I think the approach I mention above should work - just
look around in the server source code for where it does that, and
modify it as per need.

- Vasudev




More information about the Python-list mailing list