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

Remove Zend SOAP from Moodle's SOAP web service

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Setup

      1. Login as admin.
      2. Go to Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Mobile
      3. Set "Enable web services for mobile devices" (enablemobilewebservice) as checked. Click "Save changes".
      4. Go to Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Manage protocols.
      5. Enable the SOAP protocol. Click "Save changes".
      6. Go to Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Manage tokens.
      7. Click Add.
      8. On the Create token page, select a user among the list then click "Save changes". Take note of the generated token.

      Before patch

      1. Open http://[PATH_TO_MOODLE]/webservice/soap/server.php?wstoken=[TOKEN_HERE]&wsdl=1.
      2. Save the generated WSDL file (i.e. wsdl_before.xml) for comparison later.

      After the patch

      WSDL comparison

      1. Open http://[PATH_TO_MOODLE]/webservice/soap/server.php?wstoken=[TOKEN_HERE]&wsdl=1.
      2. Save the generated WSDL file (i.e. wsdl_after.xml).
      3. Using a diff tool (i.e. Meld, Winmerge, etc.), compare the two WSDL files.
        • Confirm that the files are mostly identical. (Note that there may be newly added web service functions after the patch. There may also be some missing empty message input nodes after the patch, but this is okay.)

      PHPUnit

      1. Run PHPUnit tests in webservice/tests and webservice/soap/tests.
        • Confirm that there are no errors nor failures.

      Moodle web service test client

      1. Go to Site administration ▶︎ Development ▶︎ Web service test client
      2. Under "Authentication method" select "token".
      3. Under "Protocol", select "SOAP".
      4. Under "Function", select "moodle_user_get_users_by_id"
      5. Enter the previously generated token into the token field, and enter 1 or more user ID's into the userids fields. Click "Execute".
        • Confirm that the user information associated with the entered user IDs are being displayed.
      6. Change the token field with an invalid value and click "Execute".
        • Confirm that a Moodle exception with a message like SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in ... is being shown.

      Simple client test

      1. Go to Site administration ► Plugins ► Web services ► API Documentation
      2. Choose and expand a web service function in the API Documentation page.
      3. Copy the attached soaptest.php to your Moodle root directory.
      4. Edit the soaptest.php file and set the $token with a valid WS token.
      5. Edit the $functionname and $params variable as well according to the chosen web service function.
      6. Open a browser and open http://[PATH_TO_MOODLE]/soaptest.php.
        • Confirm that with the proper input data, the web service function operation executes successfully and returns a meaningful data, whenever applicable.
      Show
      Setup Login as admin. Go to Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Mobile Set "Enable web services for mobile devices" (enablemobilewebservice) as checked. Click "Save changes". Go to Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Manage protocols. Enable the SOAP protocol. Click "Save changes". Go to Site administration ▶︎ Plugins ▶︎ Web services ▶︎ Manage tokens. Click Add. On the Create token page, select a user among the list then click "Save changes". Take note of the generated token. Before patch Open http://[PATH_TO_MOODLE]/webservice/soap/server.php?wstoken=[TOKEN_HERE]&wsdl=1 . Save the generated WSDL file (i.e. wsdl_before.xml) for comparison later. After the patch WSDL comparison Open http://[PATH_TO_MOODLE]/webservice/soap/server.php?wstoken=[TOKEN_HERE]&wsdl=1 . Save the generated WSDL file (i.e. wsdl_after.xml). Using a diff tool (i.e. Meld, Winmerge, etc.), compare the two WSDL files. Confirm that the files are mostly identical. (Note that there may be newly added web service functions after the patch. There may also be some missing empty message input nodes after the patch, but this is okay.) PHPUnit Run PHPUnit tests in webservice/tests and webservice/soap/tests. Confirm that there are no errors nor failures. Moodle web service test client Go to Site administration ▶︎ Development ▶︎ Web service test client Under "Authentication method" select "token". Under "Protocol", select "SOAP". Under "Function", select "moodle_user_get_users_by_id" Enter the previously generated token into the token field, and enter 1 or more user ID's into the userids fields. Click "Execute". Confirm that the user information associated with the entered user IDs are being displayed. Change the token field with an invalid value and click "Execute". Confirm that a Moodle exception with a message like SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in ... is being shown. Simple client test Go to Site administration ► Plugins ► Web services ► API Documentation Choose and expand a web service function in the API Documentation page. Copy the attached soaptest.php to your Moodle root directory. Edit the soaptest.php file and set the $token with a valid WS token. Edit the $functionname and $params variable as well according to the chosen web service function. Open a browser and open http://[PATH_TO_MOODLE]/soaptest.php . Confirm that with the proper input data, the web service function operation executes successfully and returns a meaningful data, whenever applicable.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-52208-master-2
    • Sprint:
      3.1 Stable Sprint 1, 3.1 Stable Sprint 2, 3.1 Sprint 3, 3.1 Sprint 4

      Description

      Since we are removing Zend framework in Moodle core, we have to remove Zend SOAP from Moodle's SOAP web service implementation.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16