xmlrpc introspection

poiboy bitbucket at safe-mail.net
Thu Apr 24 14:34:27 CEST 2003


Quick answer: Register 'system.listMethods', 'system.methodSignature',
and 'system.methodHelp' in your server and make sure they perform as
stated in the docs (listMethods returns a list of strings, etc.). Yup
- just do it all by hand.

The output for these methods are typical <methodResponse>s (snippets
available at http://www.xmlrpc.org/spec) - which *should* be taken
care of automatically by the XMLRPC server; lists and/or strings
converted to something like

<?xml version="1.0"?>
<methodResponse>
    <params>
        <param>
            <value>
                <array>
                    <data>
                       
<value><string>remoteMethodOne</string></value>
                       
<value><string>remoteMethodTwo</string></value>
                       
<value><string>remoteMethodThree</string></value>
                    </data>
                </array>
            </value>
        </param>
    </params>
</methodResponse>

..for 'server.listMethods'. In other words, you *shouldn't* have to
worry about the raw XML. Verify your server's output democratically
via the debugger link above
(http://www.dscpl.com.au/xmlrpc-debugger.php - added to my bookmarks,
mahalo Graham!) or manually by testing 'server.listMethods' at
http://xmlrpc.usefulinc.com/demo/server.php.

A headstart on introspection can be found at
http://xmlrpc-c.sourceforge.net/hacks/xmlrpc_registry.py, and there's
a detailed account of a comprehensive 'system.describeMethods'
implementation at http://xmlrpc-epi.sourceforge.net/specs/rfc.system.describeMethods.php
which I recommend for practical documentation consideration.

Two unsolicited cents worth: Complimentary RPC test cases are
invaluable (list all methods as links, click to test individually or
click "test all"). Had to get that off my chest.

Aloha, the poiboy




More information about the Python-list mailing list