Snippet List
This is a XML-RPC server, that uses arguments in URLs and every dispatcher instance is prepared in memory during webserver run. It's good, for example, for securing XML-RPC server with hashed strings and there are a lot of similar use cases.
Usage:
from xmlrpclib import ServerProxy
server = ServerProxy('http://example.com/xmlr-rpc/%s/' % something, allow_none=True)
server.do_something(*args)
- xml
- server
- dispatcher
- xmlrpc
create an instance of this class: `rpcserver = XMLRPC()` then define handlers on it with the register decorator:
@rpcserver.register("pingback.ping")
def handle_pingback(sourceURI, targetURI)
# ...
de-serialization of the arguments and serialization of the return values is handled by the XMLRPC object, so just expect python built-in types as your arguments and use them as your return values. you can also raise instances of xmlrpclib.Fault from within your handlers and a proper xmlrpc fault will be sent out as the response.
then you can use `rpcserver.view` in your urlconf to offer up your XML-RPC service at a URL:
urlpatterns = patterns('',
url(r'^$', rpcserver.view, name="xmlrpc"),
# ...
)
3 snippets posted so far.