Web service Access control exception

If you are creating or using a web service in Moodle and see the following message: { “exception”: “webservice_access_exception”, “errorcode”: “accessexception”, “message”: “Access control exception” } It can be a bit hard to troubleshoot. Generally there is a 4th item with debugging info, but this will only appear if you have the correct Moodle debugging…

Access the WSDL for a Moodle SOAP service

When you enable SOAP based web services through Moodle: Site administration > Plugins > Web Services > Overview (follow the steps) You can access the WSDL for the SOAP based service by passing the flag &wsdl=1 in your URL e.g. http://yourmoodle.com/webservice/soap/server.php?wsdl=1&wstoken=tokenifrequired

Undefined Property $webserviceprotocols

When this occurs, there is no result from a web service call and undefined property $webserviceprotocols. In the PHP error log the following appears: Undefined property: stdClass::$webserviceprotocols Check your web service protocols and ensure that the appropriate protocol is enabled. Site administration > Plugins > Web services > Manage protocols.