View XMLRPC Requests/Responses?

X

xkenneth

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.

Regards,
Ken
 
V

vasudevram

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>
 
V

vasudevram

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
 
D

draghuram

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.

You may try setting verbose to True as in:

s = xmlrpclib.Server('http://localhost:8000', verbose=True)

This will cause both requests and responses to be printed.

HTH,
Raghu
 
D

draghuram

You may try setting verbose to True as in:

s = xmlrpclib.Server('http://localhost:8000', verbose=True)

This will cause both requests and responses to be printed.

This only works from the client side. On reading your post again, it
appears as though you are looking for server side logging. Of course,
you can still write a small python xmlrpc client (setting verbose) to
see the requests/responses.
 
M

Mark T

xkenneth said:
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.

Regards,
Ken

www.wireshark.org

-Mark T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top