i have a xmlrpc web service that has NO parameters. It just does some stuff in the context of $USER (which it gets from the token) and returns a result. But no matter what, I always get 'Calling parameters do not match signature' - that old gem.
My externallib class' function is like this (the methodname in services.php is set correctly):
public static function completion_status () { global $CFG, $DB, $USER; require_once($CFG->dirroot ."/course/lib.php"); $context = get_context_instance(CONTEXT_USER, $USER->id); self::validate_context($context); $rows = $DB->get_records('vw_completions', array('WPUsername'=> $USER->username)); // pull from a VIEW return $rows; }
my parameters function looks like this:
public static function completion_status_parameters() { return new external_function_parameters( array() ); }
Every tutorial or forum post I've read so far dealing with this error talks about having some sort of mismatched property (int instead of string, etc). I can't seem to call a webservice without having any parameters, which I do not need.
In my test client I'm doing this since xmlrpc_encode_request REQUIRES a second parameter:
$post = xmlrpc_encode_request($functionname, array()); // empty array = no parameters $raw = $curl->post($moodle . '/webservice/xmlrpc/server.php'. '?wstoken=' . $login_token, $post);