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

Class SimpleXMLRPCDispatcher

Known Subclasses:
SimpleXMLRPCServer

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.
Method Summary
  __init__(self)
  register_function(self, function, name)
Registers a function to respond to XML-RPC requests.
  register_instance(self, instance)
Registers an instance 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.
  system_listMethods(self)
system.listMethods() => ['add', 'subtract', 'multiple']
  system_methodHelp(self, method_name)
system.methodHelp('add') => "Adds two integers together"
  system_methodSignature(self, method_name)
system.methodSignature('add') => [double, int, int]
  system_multicall(self, call_list)
system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => [[4], ...]
  _dispatch(self, method, params)
Dispatches the XML-RPC method.
  _marshaled_dispatch(self, data, dispatch_method)
Dispatches an XML-RPC method from marshalled (XML) data.

Method Details

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_instance(self, instance)

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 it's 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.

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

system_listMethods(self)

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

Returns a list of the methods supported by the server.

system_methodHelp(self, method_name)

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

Returns a string containing documentation for the specified method.

system_methodSignature(self, method_name)

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

Returns a list describing the signiture 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_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 it's 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.

_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.

Generated by Epydoc 1.1 on Thu Oct 16 16:37:23 2003 http://epydoc.sf.net