Web Service Not Working After Upgrade

Web Service Not Working After Upgrade

by Michael Burrei -
Number of replies: 0

I was running Moodle 2.3 and had a client web service call created to create users.  I just updated to version 2.6.1 and this script no longer executes properly.  I am not getting the error:

 

<?xml version="1.0" encoding="UTF-8" ?>
<EXCEPTION class="dml_missing_record_exception">
<ERRORCODE>invalidrecord</ERRORCODE>
<MESSAGE>Can not find data record in database table external_functions.</MESSAGE>
</EXCEPTION>

 

However I do have the following record in mdl_external_functions:

core_user_create_users  | core_user_external  | create_users |  user/externallib.php  | moodle  | moodle/user:create

 

And this is the PHP:

<?php


/// SETUP - NEED TO BE CHANGED
$token = '9538f4610f9d3d2d2add726caac8ec3f';
$domainname = 'http://christianlibertyonline.com';
$functionname = 'core_user_create_users';

// REST RETURNED VALUES FORMAT
$restformat = 'xml';

//////// moodle_user_create_users ////////

/// PARAMETERS - NEED TO BE CHANGED IF YOU CALL A DIFFERENT FUNCTION
$user1 = new stdClass();
$user1->username = 'testusername1';
$user1->password = 'testpassword1';
$user1->firstname = 'testfirstname1';
$user1->lastname = 'testlastname1';
$user1->email = 'testemail1@moodle.com';
$user1->auth = 'manual';
$user1->idnumber = 'testidnumber1';
$user1->lang = 'en';
$user1->theme = 'standard';
$user1->timezone = '-12.5';
$user1->mailformat = 0;
$user1->description = 'Hello World!';
$user1->city = 'testcity1';
$user1->country = 'au';
$users = array($user1);
$params = array('users' => $users);

/// REST CALL
header('Content-Type: text/plain');
$serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;
require_once('./curl.php');
$curl = new curl;
$resp = $curl->post($serverurl . $restformat, $params);
print_r($resp);

?>

 

Any one have any ideas?

Average of ratings: -