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

Remove Zend XML-RPC from Moodle's XML-RPC web service

    XMLWordPrintable

Details

    • MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • MDL-52209-master
    • Hide

      PHPUnit

      1. Run PHPUnit test webservice/xmlrpc/tests/lib_test.php.
        Confirm that no failures or errors occur.

      XML-RPC server test

      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 XML-RPC 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.
      9. Using a terminal, enter the following curl command:

        curl 'http://[SERVER_ADDRESS_HERE]/stable_master/webservice/xmlrpc/server.php?&wstoken=[TOKEN_HERE]' -H "Content-Type: text/xml" --data "<?xml version='1.0' encoding='UTF-8'?><methodCall><methodName>core_course_get_courses</methodName><params> </params></methodCall>"
        

        • Confirm that a proper XML-RPC response is being generated.
      10. Using the previous curl command, use an invalid token or an invalid web service method name.
        • Confirm that a proper XML-RPC fault response is being generated.

      XML-RPC client test

      1. Login as admin.
      2. Go to Site administration ▶︎ Development ▶︎ Web service test client
      3. Under "Authentication method" select "token".
      4. Under "Protocol", select "XML-RPC protocol".
      5. Under "Function", select "moodle_user_get_users_by_id"
      6. 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.
      7. Change the token field with an invalid value and click "Execute".
        • Confirm that a Moodle exception with a message like exception 'Exception' with message 'Invalid token - token not found | ERRORCODE: invalidtoken is being shown.
      Show
      PHPUnit Run PHPUnit test webservice/xmlrpc/tests/lib_test.php. Confirm that no failures or errors occur. XML-RPC server test 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 XML-RPC 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. Using a terminal, enter the following curl command: curl 'http://[SERVER_ADDRESS_HERE]/stable_master/webservice/xmlrpc/server.php?&wstoken=[TOKEN_HERE]' -H "Content-Type: text/xml" --data "<?xml version='1.0' encoding='UTF-8'?><methodCall><methodName>core_course_get_courses</methodName><params> </params></methodCall>" Confirm that a proper XML-RPC response is being generated. Using the previous curl command, use an invalid token or an invalid web service method name. Confirm that a proper XML-RPC fault response is being generated. XML-RPC client test Login as admin. Go to Site administration ▶︎ Development ▶︎ Web service test client Under "Authentication method" select "token". Under "Protocol", select "XML-RPC protocol". 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 exception 'Exception' with message 'Invalid token - token not found | ERRORCODE: invalidtoken is being shown.
    • 3.1 Stable Sprint 1

    Description

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

      Attachments

        Issue Links

          Activity

            People

              jpataleta Jun Pataleta
              jpataleta Jun Pataleta
              cameron1729 cameron1729
              Dan Poltawski Dan Poltawski
              David Monllaó David Monllaó
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                23/May/16