[Twisted-Python] Adding introspection to xlmrpc server

Glyph Lefkowitz glyph at twistedmatrix.com
Sun Jul 31 17:02:38 MDT 2011

On Jul 31, 2011, at 1:01 AM, Justin Frost wrote:

> I'm trying the example found at:
> http://twistedmatrix.com/documents/current/web/howto/xmlrpc.html#auto3
> And it doesn't seem to be working.  The following test code fails:
> import xmlrpclib
> s = xmlrpclib.ServerProxy("http://localhost:8080")
> print s.listMethods()
> The error says that the listMethods method isn't defined.  If I create an xmrpc server without twisted and add introspection, it works fine.  Is there a problem with the example or am I doing something wrong?
> Thanks,
> Justin

As per the XML-RPC introspection specification <http://xmlrpc-c.sourceforge.net/introspection.html>, the method you're looking for is 'system.listMethods', not 'listMethods'.

You can fix your client example by doing 'print s.system.listMethods()' instead of 'print s.listMethods()'.

I'm assuming that the "xmlrpc server without Twisted" is violating the spec for convenience; you can always make an xmlrpc_listMethods yourself which calls the introspection object's listMethods.

Hope this helps,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20110731/f24d45fc/attachment.html>

More information about the Twisted-Python mailing list