[Twisted-Python] xmlrpc

lals;dfjsd twisted_low at contact.com.my
Wed Nov 13 02:13:49 MST 2002


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




More information about the Twisted-Python mailing list