here's the simple example, for posterity

import os
import SimpleXMLRPCServer

class Foo:
    def settings(self):
        return os.environ
    def echo(self, something):
        return something
    def greeting(self, name):
        return "hello, " + name

handler = SimpleXMLRPCServer.CGIXMLRPCRequestHandler()
handler.register_instance(Foo())
handler.handle_request()


and here's an example of the client that has to speak with it.  My
mistake was trying to call the server thru a web browser.  The
"textcall" shows you the format of the incoming request (which I
suppose I could have built by hand by reading the spec).

import xmlrpclib

server = xmlrpclib.ServerProxy("http://127.0.0.1/cms/Foo.py";)

yoonikode = u'Sacr\xe9 Bleu'
tup = tuple([yoonikode])
print tup
textcall = xmlrpclib.dumps(tup,("server.echo"))
print textcall
print server.echo("hi")
print server.greeting("dilbert")
print server.greeting(yoonikode)

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to