I am trying the examples in www.xmlrpc.com with twisted matrix but I have hit a wall I hope that somebody can give me a hand. I am trying to call the method from my xml ... My xml code : <?xml version="1.0"?> <methodCall> <methodName>examples.tryone.Echoer.echo_something</methodName> <params> <param> <value>Name</value> </param> </params> </methodCall> My xmlrpc server code : #!c:\python22\python.exe from twisted.web import xmlrpc from twisted.internet import defer import xmlrpclib class Echoer(xmlrpc.XMLRPC): def echo_something(self,name): return name def main(): from twisted.internet.app import Application from twisted.web import server app = Application("xmlrpc") r = Echoer() app.listenTCP(7080, server.Site(r)) app.run(0) if __name__ == '__main__': main() The error I get : web.Server Traceback xml.parsers.expat.ExpatError: no element found: line 1, column 0 I a newbie at this so please forgive me if what i am doing is like really stupid or i am asking a dumb question. Thanks
On Wed, Nov 13, 2002 at 05:12:12PM +0800, lals;dfjsd wrote:
I am trying the examples in www.xmlrpc.com with twisted matrix but I have hit a wall I hope that somebody can give me a hand.
[..snip..]
My xmlrpc server code :
#!c:\python22\python.exe from twisted.web import xmlrpc from twisted.internet import defer import xmlrpclib
class Echoer(xmlrpc.XMLRPC): def echo_something(self,name):
^^^^ Shouldn't this be "xmlrpc_something"?
The error I get :
web.Server Traceback xml.parsers.expat.ExpatError: no element found: line 1, column 0
Hmm. That looks like the xmlrpc call you are sending is somehow broken, but I don't know enough about xmlrpc to say if that's the case.
I a newbie at this so please forgive me if what i am doing is like really stupid or i am asking a dumb question. Thanks
Have you looked at doc/examples/xmlrpc.py in the Twisted distribution? It includes a simple server example, and in the comments describes how to connect to it using python2.2's xmlrpclib client. -Andrew.
participants (2)
-
Andrew Bennetts -
lals;dfjsd