xmlrpc_server.module

Tracking 5.x-1.x branch
  1. drupal
    1. 5 contributions/services/servers/xmlrpc_server/xmlrpc_server.module
    2. 6 contributions/services/servers/xmlrpc_server/xmlrpc_server.module
    3. 7 contributions/services/servers/xmlrpc_server/xmlrpc_server.module

The module which implements an xml-rpc server for the services module

Functions & methods

NameDescription
xmlrpc_server_call_wrapper
xmlrpc_server_server
xmlrpc_server_server_error
xmlrpc_server_server_info@file The module which implements an xml-rpc server for the services module
xmlrpc_server_xmlrpc

File

View source
  1. <?php
  2. /**
  3. * @file
  4. * The module which implements an xml-rpc server for the services module
  5. */
  6. function xmlrpc_server_server_info() {
  7. return array(
  8. '#name' => 'XMLRPC',
  9. '#path' => 'xmlrpc'
  10. );
  11. }
  12. function xmlrpc_server_server() {
  13. require_once './includes/xmlrpc.inc';
  14. require_once './includes/xmlrpcs.inc';
  15. return xmlrpc_server(xmlrpc_server_xmlrpc());
  16. }
  17. function xmlrpc_server_xmlrpc() {
  18. $callbacks = array();
  19. foreach (services_get_all() as $method) {
  20. $callbacks[$method['#method']] = 'xmlrpc_server_call_wrapper';
  21. }
  22. return $callbacks;
  23. }
  24. function xmlrpc_server_call_wrapper() {
  25. $xmlrpc_server = xmlrpc_server_get();
  26. $method_name = $xmlrpc_server->message->methodname;
  27. $args = func_get_args();
  28. return services_method_call($method_name, $args);
  29. }
  30. function xmlrpc_server_server_error($message) {
  31. if (!is_array($message)) {
  32. $message = array($message);
  33. }
  34. $message = implode(' ', $message);
  35. $matches = array();
  36. if (preg_match("/\#(\d+)/", $message, $matches)) {
  37. $code = $matches[1];
  38. }
  39. else {
  40. $code = 1;
  41. }
  42. return xmlrpc_error($code, strip_tags($message));
  43. }