Vinjvinj,

I am in a similar situation.  I have a twisted based application server
(like your unagi).

I use an xml-rpc interface to connect to it from turbogears.  Today, my
twisted server returns an xml-string.  The goal of my next iteration is
to return a json string.  Once I get this I can try out mochikit.

I am migrating from a java-based HTML generator.  I have found that a
SOA model works very well.  I like to keep the HTML out of the twisted
server, and leave that to turbogears.

Iteration 3 will be to expose an XML-RPC interface from turbogears,
cherrypy supports XML-RPC, but I don't know if this works with
turbogears.  I really like to provide an HTML interface + an XML-RPC
interface to functionality.   Most of my projects have both human and
computer consumers of data.  An XML-RPC interface in turbogears would
allow this to happen.

I attached sample cherrypi code, let me know if you get this work under
cherrypy.  I am still about a month away from trying this.

Thanks
Mike
-------------- here is the CherryPy code for XML-RPC-------------------


----------  cherry pie server -----------------------------------

class Root:
    @cherrypy.expose
    def index(self):
        return "You're RPC server is running on!"

class RootXmlRpcServer:
    @cherrypy.expose
    def echo(self, what):
        return what

if __name__ == '__main__':
    cherrypy.root = Root()
    cherrypy.root.xmlrpc = RootXmlRpcServer()
    cherrypy.config.update( {'global': {
            'server.socketPort': 8080,
            },
            '/xmlrpc': {
                'xmlRpcFilter.on': True,
                'xmlRpcFilter.encoding': 'latin-1',
            }})
    cherrypy.server.start()

--------- xml-rpc client ----------------------------------
import xmlrpclib
s = xmlrpclib.ServerProxy('http://localhost:8080/xmlrpc')
print s.echo('toto')

Reply via email to