20.24. SimpleXMLRPCServer — Basic XML-RPC server¶
Note
The SimpleXMLRPCServer module has been merged into
xmlrpc.server in Python 3.0. The 2to3 tool will automatically
adapt imports when converting your sources to 3.0.
New in version 2.2:
New in version 2.2.
The SimpleXMLRPCServer module provides a basic server framework for
XML-RPC servers written in Python. Servers can either be free standing, using
SimpleXMLRPCServer, or embedded in a CGI environment, using
CGIXMLRPCRequestHandler.
-
class
SimpleXMLRPCServer.SimpleXMLRPCServer(addr[, requestHandler[, logRequests[, allow_none[, encoding[, bind_and_activate]]]])¶ Create a new server instance. This class provides methods for registration of functions that can be called by the XML-RPC protocol. The requestHandler parameter should be a factory for request handler instances; it defaults to
SimpleXMLRPCRequestHandler. The addr and requestHandler parameters are passed to theSocketServer.TCPServerconstructor. If logRequests is true (the default), requests will be logged; setting this parameter to false will turn off logging. The allow_none and encoding parameters are passed on toxmlrpcliband control the XML-RPC responses that will be returned from the server. The bind_and_activate parameter controls whetherserver_bind()andserver_activate()are called immediately by the constructor; it defaults to true. Setting it to false allows code to manipulate the allow_reuse_address class variable before the address is bound.Changed in version 2.5:
Changed in version 2.5: The allow_none and encoding parameters were added.