External services - unable to add functions

External services - unable to add functions

by Gentle Mark -
Number of replies: 9

I upgraded my moodle from 2.8 to 2.9
My current moodle version is 2.9.2+ ( Build 20151008)

I added a custom external service and enabled it.
But I am getting the following error when I add functions :

"Coding error detected, it must be fixed by a programmer: Cannot find file with external function implementation"

Please refer the screen short of my server environment.
Should I add any additional php extensions for my server?
If so, what are all the extensions to be installed?

I need to add the following functions to the Custom service :

  • core_user_create_users: Create users.
  • core_user_get_users_by_field: Retrieve users information for a specified unique field.
  • core_user_update_users: Update users.
  • core_course_get_courses: Return course details
  • core_course_get_categories: Return category details
  • enrol_manual_enrol_users: Manual enrol users
  • enrol_manual_unenrol_users: Manual unenrol users
  • core_enrol_get_users_courses: Get the list of courses a user is enrolled in
The purpose is to integrate moodle courses with Word Press Woo Commerce for online payments.

Can any one help? Thanks in advance.

And by the way, I have noticed an increase in moodle site page loading after upgrading to 2.9 even with my broadband speed at 512 kbps only. The site is fast. Congrats and appreciation to all the members of the moodle development team.


Attachment screen-shot-w.jpg
Average of ratings: -
In reply to Gentle Mark

Re: External services - unable to add functions

by David Monllaó -

Hi Gentle,

I don't think you should enable any extensions. If you track that error message you will see that it comes from external_function_info, do you have any 3rd party plugins with ws functions? That might be the cause.

In reply to David Monllaó

Re: External services - unable to add functions

by Gentle Mark -
Dear David,

Thanks for your reply.
ws functions means, do you mean web service functions?
I don't think I have installed any?
Please refer the screen shots for the status.

How do I track the error message?

Pl help. Ty.
Attachment screen shot-02.png
Attachment screenshot-3.png
In reply to Gentle Mark

Re: External services - unable to add functions

by Gentle Mark -

Another screen shot.

Attachment screenshot-4.png
In reply to Gentle Mark

Re: External services - unable to add functions

by David Monllaó -

Hi Gentle,

local_mobile is a non-core plugin that you installed separately, the cause might be there (or in other plugins if you have more) I will ping Juan Leyva (the plugin developer) in case he's aware of any issue there.

Thanks for commenting.

In reply to David Monllaó

Re: External services - unable to add functions

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Gentle,

how do you see the error you mentioned?, clicking in any of the Functions list links in the external services section or just in your custom service?

This error usually happens if you have a plugin/db/services.php files with functions pointing to an invalid classpath.

(I checked the last version of local_mobile and it works as expected)

Regards, Juan

In reply to Juan Leyva

Re: External services - unable to add functions

by Gentle Mark -

Hi David & Juan,

Thanks for your response.

Somehow it works now. And I don't know how. I did not do anything.

When I encountered the error, I was using the Firefox browser in Windows 10.

When I used Firefox in Windows 7, it worked.

Wonder how?

Thanks for all your responses.

In reply to Gentle Mark

Re: External services - unable to add functions

by mariam cherif -
hi all,

i want to invoke a web service imlemented in java with netbeans but i don't know  how. please can you help me? thanks


In reply to mariam cherif

Re: External services - unable to add functions

by Rob Mitchell -
I've tried to run through the test this webservice under developer tools and for some reason I keep getting the error below. I created a token 3 days ago. Could it be that?
<
EXCEPTION class="webservice_access_exception">

<ERRORCODE>accessexception</ERRORCODE>
<MESSAGE>Access control exception</MESSAGE>
<DEBUGINFO>Access to the function moodle_user_create_users() is not allowed.
There could be multiple reasons for this:
1. The service linked to the user token does not contain the function.
2. The service is user-restricted and the user is not listed.
3. The service is IP-restricted and the user IP is not listed.
4. The service is time-restricted and the time has expired.
5. The token is time-restricted and the time has expired.
6. The service requires a specific capability which the user does not have.
7. The function is called with username/password (no user token is sent)
and none of the services has the function to allow the user.
These settings can be found in Administration &gt; Site administration
&gt; Plugins &gt; Web services &gt; External services and Manage tokens.</DEBUGINFO>
</EXCEPTION>


In reply to Rob Mitchell

Re: External services - unable to add functions

by Joshua Smith -

Rob, usually this just means you haven't added access to the particular function in your web service, or your user is not one of the authorized users.