WSDL for XML-RPC ??

Brian Quinlan brian at sweetapp.com
Mon Sep 23 13:41:33 EDT 2002


> SOAP has WSDL to describe a webservice. Doeas XML-RPC have something
> similar?

XML-RPC has an optional set of methods that allow introspection. They
are:

system.listMethods()
system.methodSignature(method_name)
system.methodHelp(method_name)

Here is a usage example:

>>> from xmlrpclib import Server
>>> s = Server('http://www.sweetapp.com/cgi-bin/xmlrpc-test/rpc1.py')
>>> s.system.listMethods()
['add', 'get_source_code', 'mul', 'pow', 'system.listMethods',
'system.methodHelp', 'system.methodSignature', 'system.multicall']
>>> print s.system.methodHelp('pow')
pow(x, y[, z]) -> number

With two arguments, equivalent to x**y.  With three arguments,
equivalent to (x**y) % z, but may be more efficient (e.g. for longs).
>>>

For information on how to create servers that automatically support
these methods, see:
http://www.sweetapp.com/xmlrpc/

Cheers,
Brian





More information about the Python-list mailing list