diff -r 64d9569b4e1f Lib/xmlrpc/client.py --- a/Lib/xmlrpc/client.py Sat Oct 12 01:41:49 2013 +0200 +++ b/Lib/xmlrpc/client.py Sat Oct 12 12:06:11 2013 +0800 @@ -1461,18 +1461,18 @@ # simple test program (from the XML-RPC specification) - # server = ServerProxy("http://localhost:8000") # local server - server = ServerProxy("http://time.xmlrpc.com/RPC2") + # local server, available from Lib/xmlrpc/server.py + server = ServerProxy("http://localhost:8000") try: print(server.currentTime.getCurrentTime()) except Error as v: print("ERROR", v) - # The server at xmlrpc.com doesn't seem to support multicall anymore. multi = MultiCall(server) - multi.currentTime.getCurrentTime() - multi.currentTime.getCurrentTime() + multi.getData() + multi.pow(2,9) + multi.add(1,2) try: for response in multi(): print(response) diff -r 64d9569b4e1f Lib/xmlrpc/server.py --- a/Lib/xmlrpc/server.py Sat Oct 12 01:41:49 2013 +0200 +++ b/Lib/xmlrpc/server.py Sat Oct 12 12:06:11 2013 +0800 @@ -960,9 +960,22 @@ if __name__ == '__main__': + import datetime + + class instanceClass: + def getData(self): + return '42' + + class currentTime: + @staticmethod + def getCurrentTime(): + return datetime.datetime.now() + server = SimpleXMLRPCServer(("localhost", 8000)) server.register_function(pow) server.register_function(lambda x,y: x+y, 'add') + server.register_instance(instanceClass(), allow_dotted_names=True) + server.register_multicall_functions() print('Serving XML-RPC on localhost port 8000') try: server.serve_forever()