by davide wisdom.
Hello everybody,
I'm writing a php client for my moodle web services using SOAP.
Right now i am able to succesfully call 'core_user_get_users' and get a correct response,
but i'm stuck trying to make 'enrol_manual_enrol_users' work.
this is the call:
$client = new \SoapClient($serverUrl);
$response = $client->__soapCall('enrol_manual_enrol_users', $params);
where $param is something like:
Array
(
[enrolments] => Array
(
[0] => Array
(
[roleid] => 5
[userid] => 9
[courseid] => 7
)
)
)
also tried this:
Array
(Array
(
[0] => Array
(
[roleid] => 5
[userid] => 9
[courseid] => 7
)
)
)
and few more.
$serverUrl (correct because the other method does succeed):
http://domain/webservice/soap/server.php?wsdl=1&wstoken=token
After the call, $response is just empty and nothing happens on the moodle (the user doesn't get enrolled into the course).
The weird fact is that if i pass in wrong parameters (like: wrap it into another array, mispell something etc.. etc..), moodle doesn't complain. It does complain (as it has to) only when i mispell the name of the function.
I was kinda frustrated so i gave my moodle web services user like almost full permissions: nothing changed.
Any idea?