Version 1.9 (checked in on 2011/01/15 at 11:38:58 by ilo)
This is an example of how to implement and XML-RPC server by registering callbacks to specific methods and how to make xmlrpc calls using the built-in xmlrpc() factory provided by Drupal.
For experimentation you may be interested in the XML-RPC Tester module.
Note that the Services module is another common way to do XML-RPC at this time.
xmlrpc()
| Name | Description |
|---|---|
| xmlrpc_example_alter_form | Present a form to enable or disable the code implemented in hook_xmlrpc_alter. |
| xmlrpc_example_client_add_submit | Submit: query the XML-RPC endpoint for the method xmlrpc_example.add and report the result as a Drupal message. |
| xmlrpc_example_client_form | Present a form to get two arguments, and make a call to an XML-RPC server using these arguments as input, showing the result in a message. |
| xmlrpc_example_client_multicall_submit | Submit a multicall request: query the XML-RPC endpoint for the methods xmlrpc_example.add and xmlrpc_example.subtract and report the result as a Drupal message. Drupal's XML-RPC client builds the system.multicall request automatically when there… |
| xmlrpc_example_client_request_methods_submit | Submit: query the XML-RPC endpoint for the method system.listMethods and report the result as a Drupal message. The result is a list of the available methods in this XML-RPC server. |
| xmlrpc_example_client_subtract_submit | Submit: query the XML-RPC endpoint for the method xmlrpc_example.subtract and report the result as a Drupal message. |
| xmlrpc_example_info | A simple landing-page information function. |
| xmlrpc_example_menu | Implements hook_menu(). Register all the demonstration forms. |
| xmlrpc_example_server_form | Present a form to configure the service options. In this case the maximum and minimum values for any of the operations (add or subtraction). |
| xmlrpc_example_xmlrpc | Implements hook_xmlrpc(). |
| xmlrpc_example_xmlrpc_alter | Implements hook_xmlrpc_alter(). |
| _xmlrpc_example_alter_add | Sum the two arguments without limit checking. |
| _xmlrpc_example_alter_subtract | Return the difference of the two arguments without limit checking. |
| _xmlrpc_example_server_add | This is the callback for the xmlrpc_example.add method. |
| _xmlrpc_example_server_subtract | This is the callback for the xmlrpc_example.subtract xmlrpc method. |