[issue8792] Support Apache extensions to XML-RPC in xmlrpclib
Amaury Forgeot d'Arc
report at bugs.python.org
Sat Oct 2 18:58:16 CEST 2010
Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
It's easy enough to subclass the Transport type and add custom types to the dispatcher object, see the script below.
Attila, Bhargav, is this solution acceptable to you?
from xmlrpclib import Transport, ServerProxy
class MyTransport(Transport):
def getparser(self):
parser, unmarshaller = Transport.getparser(self)
# Get the class attribute, clone it
dispatch = unmarshaller.dispatch.copy()
# and store it on the instance
unmarshaller.dispatch = dispatch
# Now we can add custom types
dispatch["ex:i8"] = dispatch["int"]
return parser, unmarshaller
uri = "http://time.xmlrpc.com/RPC2"
server = ServerProxy(uri, transport=MyTransport(use_datetime=True))
print server.currentTime.getCurrentTime()
----------
nosy: +amaury.forgeotdarc
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8792>
_______________________________________
More information about the Python-bugs-list
mailing list