At 01:22 PM 11/20/01 -0600, Ian Bicking wrote:
>On Tue, 2001-11-20 at 07:10, Geoffrey Talvola wrote:
> > You could make it easier by writing a wrapper around the XML-RPC client
> > libraries to automatically add in the username and password to every 
> request,
> > and similar handling on the server side to validate them (i.e. a
> > SecureXMLRPCServlet subclass).  We haven't done it yet, but I've thought
> > about it a couple of times :-)
>
>Okay, so I'm giving a try at making such a servlet, complete with hashed
>passwords, and I'm finding it hard to debug -- I get a 500 Server Error
>when I run my test client program, but I can't find any record on the
>server of what the error might be -- I tried the log from the AppServer
>and Apache, and they say nothing.  I was having this same problem
>before, and only managed to stumble to a solution after blind trial and
>error.
>
>So how do you debug XMLRPC?
>
>   Ian

First, make sure that the Application.config setting 
IncludeTracebackInXMLRPCFault is set to 1.  I think it is set to 1 by 
default, but I'm not positive.  What this means is that if your XML-RPC 
method raises an exception, the text of the traceback will be returned to 
the client in an xmlrpclib.Fault object in the faultString 
attribute.  Here's an example using the XMLRPCExample servlet included with 
Webware:

 >>> from xmlrpclib import xmlrpclib
 >>> exampleServer = 
xmlrpclib.Server('http://localhost:8080/WebKitDevel/Examples/XMLRPCExample')
 >>> exampleServer.add(2, 3)
5
 >>> try:
...     exampleServer.add(2, 'x')
... except xmlrpclib.Fault, fault:
...     print fault.faultString
...
Traceback (most recent call last):
    File "D:\gat\tools\Tools\Webware\WebKit\XMLRPCServlet.py", line 37, in 
respondToPost
     response = self.call(method, params)
    File "D:\gat\tools\Tools\Webware\WebKit\XMLRPCServlet.py", line 70, in call
     return apply(getattr(self, method), params)
    File "d:\gat\tools\tools\Webware\WebKit\Examples\XMLRPCExample.py", 
line 25, in add
     return x + y
  TypeError: unsupported operand types for +
 >>>

Have you been able to get that much working?

Also, you can modify XMLRPCServlet.py so that it logs exceptions.  I'm 
attaching a patch that I've been meaning to clean up and check into Webware 
CVS but haven't gotten around to yet.


--

- Geoff Talvola
   [EMAIL PROTECTED]

Attachment: XMLRPCServlet.py.diff
Description: Binary data

Reply via email to