[Twisted-Python] Adding introspection to xlmrpc server
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 xmlrpclibs = 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
Justin Frost wrote:
I'm trying the example found at: [1]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?
Try: print s.system.listMethods() -Andrew.
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, -glyph
participants (3)
-
Andrew Bennetts
-
Glyph Lefkowitz
-
Justin Frost