I have seen a similar problem raised by Christian Pfisterer (4/10/2010,http://moodle.org/mod/forum/discuss.php?d=155287#p679932):
Well my external function now appears but when I try using it with my test client I get the following error
[message:protected] => Function ("moodle_enrol_set_manual_enrol") is not a valid method for this service
When I check the web service documentation everything is correct. Do I need to register the external function for soap????
And the following advice from Jerome Mouneyrac
- check if this function is added to the service
- check if the user has access to the service (in the token page, in the service settings page)
I have checked all of this and I am still getting the same is not a valid method error. Any suggestions?
I have tried setting this up on another Moodle site and I have run through all of the steps in the Web Services/Overview page plus the additional step of adding permissions for SOAP to the user that has the token for the service. I am now getting a different error message:
SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://myserver/moodle/webservice/soap/server.php?wstoken=e2ba2a6ef55c8f5433a7689a3532f6d4&wsdl=1' : Start tag expected, '<' not found
#0 /var/www/moodle/lib/zend/Zend/Soap/Client/Common.php(51): SoapClient->SoapClient('http://helpdesk...', Array)
#1 /var/www/moodle/lib/zend/Zend/Soap/Client.php(1024): Zend_Soap_Client_Common->__construct(Array, 'http://helpdesk...', Array)
#2 /var/www/moodle/lib/zend/Zend/Soap/Client.php(1180): Zend_Soap_Client->_initSoapClientObject()
#3 /var/www/moodle/lib/zend/Zend/Soap/Client.php(1104): Zend_Soap_Client->getSoapClient()
#4 /var/www/moodle/webservice/soap/locallib.php(155): Zend_Soap_Client->__call('moodle_user_cre...', Array)
#5 /var/www/moodle/admin/webservice/testclient.php(154): webservice_soap_test_client->simpletest('http://myserver...', 'moodle_user_cre...', Array)
I had got this to work at the end of last week on the original site I tried it on but now I'm getting the 'is not a valid method' error on that site, and the above error on the new site. What can be done?