Your search query "linkto%3A%22XmlRpc%22" didn't return any results. Please change some terms and refer to HelpOnSearching for more information.
(!) Consider performing a full-text search with your search terms.

Clear message


XML-RPC is a neat way to send messages across the Internet.

The neat thing about XML-RPC is that it transports native data structures- you can ship off lists, strings, dictionaries, and numbers.

You can read more about it over on C2, or on the XML-RPC home page.

Sample Code

   1 import xmlrpclib
   5 pythoninfo = xmlrpclib.ServerProxy( XMLRPC_SERVER_URL )
   6 allpages = pythoninfo.getAllPages() # this is the XML-RPC call
   8 print ", ".join( allpages )

This code calls the PythonInfo wiki, and receives the TitleIndex as a list.

Message Format

If you can communicate strings, you can do XML-RPC. You could even do it by e-mail!

Here's how to make your string:

   1 import xmlrpclib
   3 func_name = "foo"
   4 arg_1 = "robot"
   5 arg_2 = { "some":1, "dict":2 }
   6 arg_3 = [1,2,3,4,5]
   8 call_string = xmlrpclib.dumps( (arg_1,arg_2,arg_3,), func_name )

...resulting in the following call_string value:

<?xml version='1.0'?>

...which can then be turned back into Python data:

   1 call_data = xmlrpclib.loads( call_string )

...which then builds:

(('robot', {'some': 1, 'dict': 2}, [1, 2, 3, 4, 5]), u'foo')

That is, the first item is the arguments tuple, and the second item is the name of the function.

The capabilities are described under "Convenience Functions" in the xmlrpclib documentation.

See Also

Unable to edit the page? See the FrontPage for instructions.