Creating an XML-RPC Server : XML RPC : Network PYTHON TUTORIALS


PYTHON TUTORIALS » Network » XML RPC »

 

Creating an XML-RPC Server


import SimpleXMLRPCServer

servAddr = ("localhost"8080)

def areaSquare(length):
    return length*length

def areaRectangle(length, width):
    return length*width

def areaCircle(radius):
    return 3.14*(radius*radius)

serv = SimpleXMLRPCServer.SimpleXMLRPCServer(servAddr)

serv.register_function(areaSquare)
serv.register_function(areaRectangle)
serv.register_function(areaCircle)

serv.register_introspection_functions()

serv.serve_forever()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Network
» XML RPC