1
2
3
4 """
5 This file is part of the web2py Web Framework
6 Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
7 License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
8 """
9
10 from SimpleXMLRPCServer import SimpleXMLRPCDispatcher
11
12
13 -def handler(request, response, methods):
14 response.session_id = None
15 dispatcher = SimpleXMLRPCDispatcher(allow_none=True, encoding=None)
16 for method in methods:
17 dispatcher.register_function(method)
18 dispatcher.register_introspection_functions()
19 response.headers['Content-Type'] = 'text/xml'
20 dispatch = getattr(dispatcher, '_dispatch', None)
21 return dispatcher._marshaled_dispatch(request.body.read(), dispatch)
22