Introspection: Discovering Server APIs

Edd Dumbill proposed the following set of methods:

array system.listMethods ()
string system.methodHelp (string methodName)
array system.methodSignature (string methodName)

If a server supports these methods, you can ask it to print out some documentation:

    import xmlrpclib
    server = xmlrpclib.Server("http://xmlrpc-c.sourceforge.net/api/sample.php")
    for method in server.system.listMethods():
        print method
        print server.system.methodHelp(method)
        print

These methods are currently supported by servers written in PHP, C and Microsoft .NET. Partial introspection support is included in recent updates to UserLand Frontier. Introspection support for Perl, Python and Java is available at the XML-RPC Hacks page. Please feel free to add introspection support to other XML-RPC servers!

Various client-side tools (documentation generators, wrapper generators, and so on) can be found at the XML-RPC Hacks page as well.