SimpleXMLRPCServer help

John Abel john.abel at pa.press.net
Fri Jul 12 08:58:38 EDT 2002


You need to be doing something like

import xmlrpclib

if __name__== "__main__":
    ServerConn = xmlrpclib.Server ("http://localhost:8000")
    print ServerConn.add (1,2 )
    print ServerConn.pow (2,1 )
        
Hope that helps (hope even more that it works! :).

Regards

John


On Fri, 2002-07-12 at 13:23, Eric Texier wrote:
    help(SimpleXMLRPCServer) describe how to install an instance
    on the server:
    
    2. Install an instance:
    
        class MyFuncs:
            def __init__(self):
                # make all of the string functions available through
                # string.func_name
                import string
                self.string = string
            def pow(self, x, y): return pow(x, y)
            def add(self, x, y) : return x + y
        server = SimpleXMLRPCServer(("localhost", 8000))
        server.register_instance(MyFuncs())
        server.serve_forever()
    
    BUT I cannot figure out the syntax to access it from a client point of
    view
    I will appreciate a quick example even not tested.
    Thanks,
    Eric
    
    
    
    -- 
http://mail.python.org/mailman/listinfo/python-list







More information about the Python-list mailing list