Module SimpleXMLRPCServer :: Class SimpleXMLRPCDispatcher
[hide private]
[frames] | no frames]

_ClassType SimpleXMLRPCDispatcher

Known Subclasses:

Mix-in class that dispatches XML-RPC requests.

This class is used to register XML-RPC method handlers and then to dispatch them. There should never be any reason to instantiate this class directly.

Instance Methods [hide private]
 
__init__(self, allow_none, encoding)
 
register_instance(self, instance, allow_dotted_names=False)
Registers an instance to respond to XML-RPC requests.
 
register_function(self, function, name=None)
Registers a function to respond to XML-RPC requests.
 
register_introspection_functions(self)
Registers the XML-RPC introspection methods in the system namespace.
 
register_multicall_functions(self)
Registers the XML-RPC multicall method in the system namespace.
 
_marshaled_dispatch(self, data, dispatch_method=None)
Dispatches an XML-RPC method from marshalled (XML) data.
 
system_listMethods(self)
system.listMethods() => ['add', 'subtract', 'multiple']
 
system_methodSignature(self, method_name)
system.methodSignature('add') => [double, int, int]
 
system_methodHelp(self, method_name)
system.methodHelp('add') => "Adds two integers together"
 
system_multicall(self, call_list)
system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => [[4], ...]
 
_dispatch(self, method, params)
Dispatches the XML-RPC method.
Method Details [hide private]

register_instance(self, instance, allow_dotted_names=False)

 
Registers an instance to respond to XML-RPC requests.

Only one instance can be installed at a time.

If the registered instance has a _dispatch method then that
method will be called with the name of the XML-RPC method and
its parameters as a tuple
e.g. instance._dispatch('add',(2,3))

If the registered instance does not have a _dispatch method
then the instance will be searched to find a matching method
and, if found, will be called. Methods beginning with an '_'
are considered private and will not be called by
SimpleXMLRPCServer.

If a registered function matches a XML-RPC request, then it
will be called instead of the registered instance.

If the optional allow_dotted_names argument is true and the
instance does not have a _dispatch method, method names
containing dots are supported and resolved, as long as none of
the name segments start with an '_'.

    *** SECURITY WARNING: ***

    Enabling the allow_dotted_names options allows intruders
    to access your module's global variables and may allow
    intruders to execute arbitrary code on your machine.  Only
    use this option on a secure, closed network.

register_function(self, function, name=None)

 

Registers a function to respond to XML-RPC requests.

The optional name argument can be used to set a Unicode name for the function.

register_introspection_functions(self)

 

Registers the XML-RPC introspection methods in the system namespace.

see http://xmlrpc.usefulinc.com/doc/reserved.html

register_multicall_functions(self)

 

Registers the XML-RPC multicall method in the system namespace.

see http://www.xmlrpc.com/discuss/msgReader$1208

_marshaled_dispatch(self, data, dispatch_method=None)

 

Dispatches an XML-RPC method from marshalled (XML) data.

XML-RPC methods are dispatched from the marshalled (XML) data using the _dispatch method and the result is returned as marshalled data. For backwards compatibility, a dispatch function can be provided as an argument (see comment in SimpleXMLRPCRequestHandler.do_POST) but overriding the existing method through subclassing is the prefered means of changing method dispatch behavior.

system_listMethods(self)

 

system.listMethods() => ['add', 'subtract', 'multiple']

Returns a list of the methods supported by the server.

system_methodSignature(self, method_name)

 

system.methodSignature('add') => [double, int, int]

Returns a list describing the signature of the method. In the above example, the add method takes two integers as arguments and returns a double result.

This server does NOT support system.methodSignature.

system_methodHelp(self, method_name)

 

system.methodHelp('add') => "Adds two integers together"

Returns a string containing documentation for the specified method.

system_multicall(self, call_list)

 

system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => [[4], ...]

Allows the caller to package multiple XML-RPC calls into a single request.

See http://www.xmlrpc.com/discuss/msgReader$1208

_dispatch(self, method, params)

 

Dispatches the XML-RPC method.

XML-RPC calls are forwarded to a registered function that matches the called XML-RPC method name. If no such function exists then the call is forwarded to the registered instance, if available.

If the registered instance has a _dispatch method then that method will be called with the name of the XML-RPC method and its parameters as a tuple e.g. instance._dispatch('add',(2,3))

If the registered instance does not have a _dispatch method then the instance will be searched to find a matching method and, if found, will be called.

Methods beginning with an '_' are considered private and will not be called.