LMSouq
moodle-core Open

Calling Moodle functions from PHP over SOAP

BR
Brad
1 month ago
3 views
Problem Description
I am having difficulty getting started with interfacing my PHP script to [Moodle][1] 2.0 over the SOAP Web Service provided. Not knowing much about SOAP, I figured I would simply connect and go from there. However, I can't even get connected... $soap=new SoapClient( 'http://mymoodleserver/webservice/xmlrpc/server.php?wstoken=asdfasdfasdfasdfasdf', array( 'trace'=>1, 'exceptions'=>true, 'cache_wsdl'=>WSDL_CACHE_NONE ) ); This returns: >Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load... If I were to go to this URL directly, no data is returned. Looking at it with Fiddler shows that the server does indeed return a Content-Length of 0. There isn't any documentation on this that I could find... there is [documentation for other protocols][2] however. I am assuming that the [SoapClient][3] is expecting some WSDL to define what functions are available. I have a list of those functions and parameters (no thanks to the [official documentation page][4]). How can I instruct SoapClient to not worry about the WSDL and carry on? I have checked for errors in the PHP error log on the Moodle server, and it turned up clean. [1]: http://www.moodle.org [2]: http://docs.moodle.org/en/Development:Creating_a_web_service_client [3]: http://www.php.net/manual/en/soapclient.soapclient.php [4]: http://docs.moodle.org/en/Development:Web_services_API_-_Function_List

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base