by Richard Taylor.
I am trying to run the core_course_get_contents function through a SOAP call but I can't seem to pass the correct input parameter. I've tried passing the course ID as an object and as an array but each time I receive the error code 'invalidparameter'.
Can anyone adapt the code below to show me how to pass the courseid as a valid parameter? Thanks in advance.
<?php
$client = new SoapClient('http://serverurl/webservice/soap/server.php'. '?wsdl=1&wstoken=ourToken');
try {
$resp = $client->__soapCall('core_course_get_contents', array('courseid'=>5));
} catch (Exception $e) {
print_r($e);
}
if (isset($resp)) {
print_r($resp);
}
?>