The Groovy XML-RPC library 0.5 allows me to do perform basic authorization, but my Trac Server now throws a error code 500 at me (stating XML declaration not well-formed). Since I dont know how to check the XML request the library posts, I choose to dissect the messages at the network level using Wireshark. Luckily I have a Python library that works fine, so I can compare the working version of the XML-RPC request. (Remark: Dont forget to start wireshark as root user/sudo)
- 2010-01-07 09:03:03,095 Trac[main] DEBUG: Dispatching <Request "POST u'/login/xmlrpc'">
- 2010-01-07 09:03:03,117 Trac[main] ERROR: Internal Server Error:
- Traceback (most recent call last):
- File "/usr/local/Python-2.5.2/lib/python2.5/site-packages/trac/web/main.py", line 441, in _dispatch_request
- dispatcher.dispatch(req)
- File "/usr/local/Python-2.5.2/lib/python2.5/site-packages/trac/web/main.py", line 205, in dispatch
- resp = chosen_handler.process_request(req)
- File "/usr/local/Python-2.5.2/lib/python2.5/site-packages/TracXMLRPC-1.0.6-py2.5.egg/tracrpc/web_ui.py", line 163, in process_request
- self.process_xml_request(req, content_type)
- File "/usr/local/Python-2.5.2/lib/python2.5/site-packages/TracXMLRPC-1.0.6-py2.5.egg/tracrpc/web_ui.py", line 167, in process_xml_request
- args, method = xmlrpclib.loads(req.read(int(req.get_header('Content-Length'))))
- File "/usr/local/Python-2.5.2/lib/python2.5/xmlrpclib.py", line 1130, in loads
- p.feed(data)
- File "/usr/local/Python-2.5.2/lib/python2.5/xmlrpclib.py", line 547, in feed
- self._parser.Parse(data, 0)
- ExpatError: XML declaration not well-formed: line 1, column 30
- 2010-01-07 09:03:03,121 Trac[chrome] DEBUG: Prepare chrome data for request
Python Library/Call
- import xmlrpclib
- server = xmlrpclib.ServerProxy("http://user:password@sometracserver.com/login/xmlrpc")
- print server.wiki.getPage("WikiStart")
Result in Wireshark
Groovy Call
Result in Wireshark
There is the problem: encoding=”+ENCODING+”
The Trac XML reader most likely will throw up the complete call because of this. Actually the comparison was not really required because the error is very obvious.





