Advanced features) // 3- Enable XMLRPC protocol (Admin > Plugins > Web services > Manage protocols) // 4- Create a token for a specific user and for the service 'My service' (Admin > Plugins > Web services > Manage tokens) // 5- Run this script directly from your browser: you should see 'Hello, FIRSTNAME' /// SETUP - NEED TO BE CHANGED $token = 'ba67e5abeaf65bcb8397b39ebf1e1856'; //'49d164aa3585e3ff13c9ab1b123abd67'; $domainname = 'http://localhost/moodle'; /// FUNCTION NAME $functionname = 'local_ws_evl_get_usage_statistics'; /// PARAMETERS $welcomemsg = 'Hello, '; ///// XML-RPC CALL header('Content-Type: text/plain'); $serverurl = $domainname . '/webservice/xmlrpc/server.php'. '?wstoken=' . $token; require_once('./curl.php'); $curl = new curl; $post = xmlrpc_encode_request($functionname, array()); $resp = xmlrpc_decode($curl->post($serverurl, $post)); print_r($resp); //print_r ($post);