. /** * XML-RPC client class */ class webservice_xmlrpc_client { /** * Execute client WS request with token authentication * @param string $entrypointurl * @param string $token * @param string $functionname * @param array $params * @return mixed */ public function call($entrypointurl, $token, $functionname, $params) { global $DB, $CFG; //zend expects 0 based array with numeric indexes $params = array_values($params); //traditional Zend xmlrpc client call (integrating the token into the URL) require_once 'Zend/XmlRpc/Client.php'; $serverurl = $entrypointurl."?wstoken=".$token; $client = new Zend_XmlRpc_Client($serverurl); $result = $client->call($functionname, $params); return $result; } }