-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
2.6.1
-
None
-
MOODLE_26_STABLE
Hi,
I'm trying to work out whether this should work in 2.6.
Using the Java code below to call it using REST.
String functionName = "core_user_get_users";
/// XML-RPC CALL
String urlParameters = "criteria[0][key]=username&criteria[0][value]=test";
String serverURL = this.VLE_URL + "?wstoken=" + VLE_AuthorizationKey + "&wsfunction=" + functionName;
log(serverURL);
HttpURLConnection con = (HttpURLConnection) new URL(serverURL).openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("Content-Language", "en-US");
con.setDoOutput(true);
con.setUseCaches(false);
con.setDoInput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
At the moment calling the function using both REST and XML-RPC results in a error from the service.
REST produces the error below.
<methodResponse><fault><value><struct><member><name>faultCode</name><value><int>631</int></value></member><member><name>faultString</name><value><string>Failed to parse request</string></value></member></struct></value></fault></methodResponse>
XML-RPC produces the invalid parameter described earlier in this thread.
Assuming my code is correct ....
Any ideas where this one stands.
This function is pretty key if you want to Add/Remove users from Moodle via the webservices....
An answer would be appreciated.
Thanks
Bill