E D R , A S I H C RSS

Python Xml Rpc

다음은 간단한 예제.
~cpp 
#xmlrpctest.py

import SocketServer
import xmlrpcserver
import xmlrpclib

class MyRequestHandler(xmlrpcserver.RequestHandler):
    #Override method:
    
    def call(self, method, params):
        print "Dispatching: " , method, params
        try:
            server_method = getattr(self, method)
        except:
            raise AttributeError, "No XML-RPC procedure %s" % method
        return server_method(params)

    def test(self, k):
        return k[0]+1

    def dumptest(self, params):
        return xmlrpclib.dumps(params)

if __name__=='__main__':
    server = SocketServer.TCPServer(('', 8000), MyRequestHandler)
    server.serve_forever ()

Thread

신기하다. 이글루스에 바로 글쓰기가 되네. - 임인택
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2009-05-27 07:09:19
Processing time 0.0893 sec