Web Services plugin working in Moodle 2.0.3 but not in 2.1

Web Services plugin working in Moodle 2.0.3 but not in 2.1

by Joe Cape -
Number of replies: 2
Picture of Plugin developers

I have created a web service function to automatically create a user when they are created on an external system. To do this, the externallib file requires various files with classes defined which, when given the external user id, give the user details. These are then used in the ws function to create a Moodle user. This is needed (rather than an authentication plugin) so that students can exist in Moodle before they log in for the first time. 

The trouble is that this was working without hitch in Moodle 2.0.3 but having carried it across to 2.1, calling the web service function results in errors like ': Uncaught SoapFault exception: [SOAP-ENV:Server] Access to undeclared static property: '. It fails to recognise that instantiated classes are inherited and therefor breaks when any self::...  functions are called, but it does respond as it should when $this-> ... functions are called. Does anyone have an idea of what might cause this problem in Moodle 2.1 ? Cheers. 

Average of ratings: -
In reply to Joe Cape

Re: Web Services plugin working in Moodle 2.0.3 but not in 2.1

by Jérôme Mouneyrac -

Hi Jos,

can you set the debug mode in Moodle to Developer. Then give us the traceback displayed in the server log. In case you already know this being a core issue, you can write a tracker issue.

Thank you,
Jerome 

In reply to Jérôme Mouneyrac

Re: Web Services plugin working in Moodle 2.0.3 but not in 2.1

by Joe Cape -
Picture of Plugin developers

Thanks for the response. I have been using the on-screen debugging, which of course I can't see while using/testing web services. The issue was fixed by changing all of the function calls from self::... to $this->... , so making calls on the object rather than the class. 

I'm not sure whether the problem was with the function I am using or with Moodle's SOAP/Web Services API, so not sure if I should create a tracker for this...