Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-45567

core_user_get_users Web Service appears to be broken in 2.6

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.6.1
    • Fix Version/s: None
    • Component/s: Web Services
    • Labels:
      None
    • Affected Branches:
      MOODLE_26_STABLE

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bill@ashtree-partnership.com Bill Stock
                Participants:
                Component watchers:
                Juan Leyva, Jake Dallimore, Jun Pataleta
              • Votes:
                4 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: