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

Soap protocol broken in Moodle 4.2

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_402_STABLE
    • MDL-78094-master
    • Hide
      1. Enable web services (Site administration > Advanced features)
      2. Enable SOAP (Site administration > server > webservices > overview > Manage protocols)
      3. Create a new external service ((Site administration > server > webservices > overview > External services. Note: don't use the mobile one)
      4. Add the function core_get_string to the service
      5. Create a token for the admin user for this service (copy this, we'll use it in a few steps' time)
      6. Go to the "Test the service" (the bottom option in web services overview)
      7. Set method = token, protocol = SOAP, function = core_get_string and click "Select"
      8. On the next page, set:
        Token: the token you created from admin
        stringid: error
        component: moodle
        lang: en
      9. Click "Execute"
      10. Verify you see "Error" returned and no errors on the page.
      Show
      Enable web services (Site administration > Advanced features) Enable SOAP (Site administration > server > webservices > overview > Manage protocols) Create a new external service ((Site administration > server > webservices > overview > External services. Note: don't use the mobile one) Add the function core_get_string to the service Create a token for the admin user for this service (copy this, we'll use it in a few steps' time) Go to the "Test the service" (the bottom option in web services overview) Set method = token, protocol = SOAP, function = core_get_string and click "Select" On the next page, set: Token: the token you created from admin stringid: error component: moodle lang: en Click "Execute" Verify you see "Error" returned and no errors on the page.

      Soap protocol is broken in Moodle 4.2 because of a class rename. external_api was renamed to \core_external\external_api

      webservice/soap/locallib.php contains:

      external_api::set_timeout();

      should be:

      \core_external\external_api::set_timeout();

      Replication steps

      1. Enable web services (admin > adv. features)
      2. Enable SOAP (admin > server > webservices > overview > protocols)
      3. Create a new external service (don't use the mobile one)
      4. Add the method core_get_string to the service
      5. Create a token for the admin user for this service (copy this, we'll use it in a few steps' time)
      6. Go to the "Test the service" (the bottom option in web services overview)
      7. Set method = token, protocol = SOAP, function = core_get_string and click "Select"
      8. On the next page, set:
        Token: the token you created from admin
        stringid: error
        component: moodle
        lang: en
      9. Execute it
        Expected: You see "Error" returned.
        Actual: You see this:

      URL: http://localhost/master/webservice/soap/server.php?wstoken=02b5f4bf7f6f2bc3e332b2c9a2944c99SoapFault
       exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 
      'http://localhost/master/webservice/soap/server.php?wstoken=02b5f4bf7f6f2bc3e332b2c9a2944c99&wsdl=1'
       : failed to load external entity 
      "http://localhost/master/webservice/soap/server.php?wstoken=02b5f4bf7f6f2bc3e332b2c9a2944c99&wsdl=1"
       in /home/jake/moodledata/master/moodle/webservice/soap/lib.php:89
      Stack trace:
      #0 /home/jake/moodledata/master/moodle/webservice/soap/lib.php(89): SoapClient->__construct()
      #1 /home/jake/moodledata/master/moodle/webservice/soap/locallib.php(334): webservice_soap_client->call()
      #2 /home/jake/moodledata/master/moodle/admin/webservice/testclient.php(151): webservice_soap_test_client->simpletest()
      #3 {main}

        1. MDL-78094.png
          MDL-78094.png
          135 kB
        2. soap001.png
          soap001.png
          59 kB

            jaked Jake Dallimore
            evsoldatkin Evgeny Soldatkin
            Safat Shahin Safat Shahin
            Ilya Tregubov Ilya Tregubov
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 40 minutes
                40m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.