xmlrpc_server.module in Services 5
The module which implements an xml-rpc server for the services module
File
servers/xmlrpc_server/xmlrpc_server.moduleView source
<?php
/**
* @file
* The module which implements an xml-rpc server for the services module
*/
function xmlrpc_server_server_info() {
return array(
'#name' => 'XMLRPC',
'#path' => 'xmlrpc',
);
}
function xmlrpc_server_server() {
require_once './includes/xmlrpc.inc';
require_once './includes/xmlrpcs.inc';
return xmlrpc_server(xmlrpc_server_xmlrpc());
}
function xmlrpc_server_xmlrpc() {
$callbacks = array();
foreach (services_get_all() as $method) {
$callbacks[$method['#method']] = 'xmlrpc_server_call_wrapper';
}
return $callbacks;
}
function xmlrpc_server_call_wrapper() {
$xmlrpc_server = xmlrpc_server_get();
$method_name = $xmlrpc_server->message->methodname;
$args = func_get_args();
return services_method_call($method_name, $args);
}
function xmlrpc_server_server_error($message) {
if (!is_array($message)) {
$message = array(
$message,
);
}
$message = implode(' ', $message);
$matches = array();
if (preg_match("/\\#(\\d+)/", $message, $matches)) {
$code = $matches[1];
}
else {
$code = 1;
}
return xmlrpc_error($code, strip_tags($message));
}
Functions
Name | Description |
---|---|
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 |