To integration with Moodle, you can connect directly to its Database or you can use the Web Service plugin. In most situation, we recommend you to use Web Service due to the complexity of the Database Schema.
For Moodle Web Service Plugin, it supports the following protocols:
This blog will show you how to set up the SOAP Web Service using Moodle 2.3.1+.
Step 1: Firewall Rules for Inbound Data
If your Web Service client is outside your secure network, please ensure that the Moodle server has the firewall rules configured to accept the incoming connection.
Step 2: Enable Web Service
Enable web services at Site administration > Advanced features.
Step 3: Enable SOAP Protocol
1) Go to Site administration > Advanced features > Plugins > Web services > Manage Protocols
2) Enable SOAP Protocol
Step 4: Add New External Service and Functions
1) Go to Site administration > Advanced features > Plugins > Web services > External services
2) Click Add.
3) Add in any function you require in the web service
Step 5: Generate the User Token
1) Go to Site administration > Advanced features > Plugins > Web services > Manage tokens
2) Associate your web service user with your External service.
3) Tick the Enable checkbox and set the expiry date.
Once you save it, you should get the User Token that looks like this:
Step 5: Web service test client
We should be ready to go now. To ensure that this is working, we can test it with the “Web service test client”. This service can be found under Site Administration > Development.