Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29276 META- Web service improvements for 2.2
  3. MDL-29843

Access control exception are not properly "catched" by the SOAP demo client

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Not a bug
    • Affects Version/s: 2.1.2
    • Fix Version/s: None
    • Component/s: Web Services
    • Labels:
      None
    • Affected Branches:
      MOODLE_21_STABLE

      Description

      Call SOAP demo client with any access control exception (missing soap capability, valid until date expired on the token...)

      When the SOAP client requests the WSDL (new SoapClient($serverurl), the server will throw an exception during the WSDL generation. This exception is converted by the server into a SOAPFAULT. Somehow the client does not recognize this format.

      It could be an error on the client (maybe a setup) or it could be the server that returned a format not recognized by PHP SOAP Client.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              jerome Jérôme Mouneyrac added a comment - - edited

              Here the issue is that the client seems to not catch the exception 'Access control exception'?

              Show
              jerome Jérôme Mouneyrac added a comment - - edited Here the issue is that the client seems to not catch the exception 'Access control exception'?
              Hide
              jerome Jérôme Mouneyrac added a comment -

              I confirm the demo client ignore the return SOAP error message returned by our Zend server, maybe this error message is misformed (only recognized by Zend SOAP Client??)...

              Show
              jerome Jérôme Mouneyrac added a comment - I confirm the demo client ignore the return SOAP error message returned by our Zend server, maybe this error message is misformed (only recognized by Zend SOAP Client??)...
              Hide
              jerome Jérôme Mouneyrac added a comment -

              I don't think it is possible for the WSDL to indicate that an error has been produced during its generation. So the core code seems ok. When the WSDL generation fails, it returns some xml like:

              <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
              <SOAP-ENV:Body>
              <SOAP-ENV:Fault>
              <faultcode>MOODLE:error</faultcode>
              <faultstring>
              Access control exception - Access to web service not allowed
              </faultstring>
              </SOAP-ENV:Fault>
              </SOAP-ENV:Body>
              </SOAP-ENV:Envelope>

              I updated the SOAP client to detect any wrongly generated WSDL: https://github.com/moodlehq/sample-ws-clients/tree/master/PHP-SOAP

              In conclusion, not a bug.

              Show
              jerome Jérôme Mouneyrac added a comment - I don't think it is possible for the WSDL to indicate that an error has been produced during its generation. So the core code seems ok. When the WSDL generation fails, it returns some xml like: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>MOODLE:error</faultcode> <faultstring> Access control exception - Access to web service not allowed </faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> I updated the SOAP client to detect any wrongly generated WSDL: https://github.com/moodlehq/sample-ws-clients/tree/master/PHP-SOAP In conclusion, not a bug.
              Hide
              nebgor Aparup Banerjee added a comment -

              when attempting to access a WSDL , the protocol is HTTP so how about using 'HTTP status 401: Access Denied' ?

              Show
              nebgor Aparup Banerjee added a comment - when attempting to access a WSDL , the protocol is HTTP so how about using 'HTTP status 401: Access Denied' ?

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: