Hey everyone,
I have a fair amount of experience administering Moodle servers, but on the Web service front, I'm a bit over my head.
We are currently running 1.98+, and I have two scenarios:
1) Pass parameters to an external system using SOAP when a student clicks on a link in a courses.
- Student is on Web page in a course
- Student clicks on a link
- Students username and the course ID are passed to an external system via SOAP
- External system returns properties that are displayed on a Web page in the Moodle course.
2) Authentication against an Enterprise Identity Management (EIM) system through a SOAP interface. We currently authenticate employees against an LDAP directory, and I want authenticate customers and partners against an EIM system that has a SOAP service configured. Ideally, the EIM system is checked before the LDAP directory server is checked.
Thanks for any insight - much appreciated.
Ben
SOAP and Moodle
Number of replies: 1Re: SOAP and Moodle
Hi Ben
For both scenarios I suggest you to use the NuSOAP library, which greatly simplifies consuming external Web Services from Moodle.
The following code may result useful to you:
1 require_once($CFG->libdir.'/soap/nusoap.php');
2 $wsdl = "http://ip:port/foo/bar?wsdl";
3 $client = new soap_client($wsdl, 'wsdl');
4 $param = array($section);
5 $result = $client->call('name_of_method', $param);
3 $client = new soap_client($wsdl, 'wsdl');
4 $param = array($section);
5 $result = $client->call('name_of_method', $param);
Regards,
Roberto Perez-Rodriguez
University of Vigo