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

Web service test client: SoapFault exception: [Sender] Function (...) is not a valid method for this service in ...

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Web Services
    • Labels:
      None
    • Environment:
      n/a
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      To reproduce the problem:

      Fetch the latest release from git:
      git clone git://git.moodle.org/moodle.git ltu_moodle_git

      Enable WS

      Site admin > Advanced Features
      TICK: Enable web services
      "Save changes"

      Enable protocol (SOAP) and WS documentation

      Site admin > Plugins > Web services > Manage protocols
      Enable SOAP protocol
      TICK: Web services documentation
      "Save changes"

      Create a role for WS

      Site admin > Users > Permissions > Define roles > Add new role
      Role name: moodle_ws_role
      Role archetype: None
      Context type: System
      Capabilities:
      Use SOAP protocol (webservice/soap:use),
      moodle/role:assign,
      moodle/user:update,
      moodle/course:managegroups,
      moodle/user:viewdetails,
      moodle/user:create,
      moodle/site:viewparticipants,
      moodle/course:viewparticipants,
      moodle/role:review,
      moodle/site:accessallgroups,
      moodle/course:enrolreview,
      moodle/user:delete
      "Create this role" --> Error output

      Create a user for WS

      Site admin > Users > Accounts > Add a new user
      Name: Web Services User
      Username: moodle_ws
      Password: P@$$W0rd
      Authentication method: Web services authentication
      "Update profile"

      Added user to role

      Site admin > Users > Permissions > Assign system roles

      Enable WS authentication

      Site admin > Plugins > Authentication > Manage authentication
      Enable Web services authentication
      "Save changes"

      Create a service and functions

      Site admin > Plugins > Web services > External services > Add
      Service name: external_ws
      TICK: Enabled
      TICK: Authorised users only
      Click "Show Advanced"
      Select "No required capability"
      "Add service"
      > Add functions
      Select << ALL >> functions
      "Add functions"

      Authorise WS user to use the external WS

      Site admin > Plugins > Web Services > External service users
      Add WS user to authorised users
      --> Get message: Missing capabilities: moodle/role:assign,moodle/user:update,moodle/course:managegroups,moodle/user:viewdetails,moodle/user:create,moodle/site:viewparticipants,moodle/course:viewparticipants,moodle/role:review,moodle/site:accessallgroups,moodle/course:enrolreview,moodle/user:delete.

      Create a token

      Site admin > Plugins > Web services > Manage tokens
      User: Web Services User
      Service: external_ws
      "Save changes"
      Token: f230d145113d7d9b0bb49f3e00072706

      Test web service using simple or token

      Error:

      SoapFault exception: [Sender] Function ("moodle_user_get_users_by_id") is not a valid method for this service in /home/bsusas/public_html/ltu_moodle_git/lib/zend/Zend/Soap/Client.php:1113
      Stack trace:
      #0 /home/user/public_html/ltu_moodle_git/lib/zend/Zend/Soap/Client.php(1113): SoapClient->__soapCall('moodle_user_get...', Array, NULL, NULL, Array)
      #1 /home/user/public_html/ltu_moodle_git/webservice/soap/locallib.php(152): Zend_Soap_Client->__call('moodle_user_get...', Array)
      #2 /home/user/public_html/ltu_moodle_git/admin/webservice/testclient.php(155): webservice_soap_test_client->simpletest('http://<URL>...', 'moodle_user_get...', Array)
      #3

      {main}

        Attachments

          Activity

            People

            Assignee:
            jerome Jérôme Mouneyrac
            Reporter:
            alandberg Anders Landberg
            Tester:
            Nobody
            Participants:
            Component watchers:
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10