How to debug Apache XML-RPC client with Python server

1.9k Views Asked by At

I am writing xmlrpc codes to communicate between Apache XML-RPC client and a Python SimpleXMLRPCServer. I have difficulty debugging it, because I can't find a way to see the request XML/response XML. Are there anyway I can see it dump to console or logged in file?

3

There are 3 best solutions below

0
On BEST ANSWER

Use a network packet sniffer like ethereal or wireshark.

0
On

To debug the Python SimpleXMLRPCServer code you can use rpdb https://pypi.python.org/pypi/rpdb.

Add rpdb.set_trace() in the server side code where you want to set the breakpoint. It opens the debugger on port 4444. To connect to the debugger, telnet to port 4444.

In the SimpleXMLRPCServer debug session you can see the request XML/response XML.

0
On

You can also use verbose=True in python xmlrpc client Example:

s = xmlrpclib.ServerProxy('http://test.xmlrpc.wordtracker.com/',verbose=True,encoding='UTF-8')