Example: XML-RPC

Same name in other branches
  1. 7.x-1.x xmlrpc_example/xmlrpc_example.module \xmlrpc_example

XML-RPC client/server. (drupal 6)

This is an example of how to implement an XML-RPC server by registering callbacks to specific methods and how to make xmlrpc calls using the builtin xmlrpc() factory provided by Drupal.

For experimentation you may be interested in the XMLRPC Tester module.

Note that the Services module is probably the more common way to do XMLRPC at this time.

See also

hook_xmlrpc()

xmlrpc()

xmlrpc_errno()

xmlrpc_error_msg()

Parent topics

File

xmlrpc_example/xmlrpc_example.module, line 20

Functions

Title Sort descending File name Summary
xmlrpc_example_client_add_submit xmlrpc_example/xmlrpc_example.module Submit: query the xmlrpc endpoint for the method xmlrpc_example.add
and report the result.
xmlrpc_example_client_form xmlrpc_example/xmlrpc_example.module Present a form that makes use of xmlrpc services to add or subtract.
xmlrpc_example_client_subtract_submit xmlrpc_example/xmlrpc_example.module Submit for subtraction: Call the xmlrpc method and report the result.
xmlrpc_example_menu xmlrpc_example/xmlrpc_example.module Implementation of hook_menu().
Register all the demonstration forms.
xmlrpc_example_server_form xmlrpc_example/xmlrpc_example.module Present a form to configure the xmlrpc service options. In this case the max
and min values for any of the operations (add or subtraction).
xmlrpc_example_xmlrpc xmlrpc_example/xmlrpc_example.module Implements hook_xmlrpc().
_xmlrpc_example_server_add xmlrpc_example/xmlrpc_example.module Sum the two arguments.
_xmlrpc_example_server_subtract xmlrpc_example/xmlrpc_example.module Return the difference of the two arguments.