|
|
(39 intermediate revisions by 10 users not shown) |
Line 1: |
Line 1: |
| {{Moodle_2.0}} | | {{Template:Migrated|newDocId=/docs/apis/subsystems/external/}} |
| | |
| ==Introduction==
| |
| This page described the Web Services module implemented for Moodle 2.0<br>
| |
| The official discussion [http://moodle.org/mod/forum/view.php?id=6971| forum is here]<br>
| |
| The tracker issues are here: MDL-12886 and MDL-17135<br>
| |
| This module is been implemented by Moodle HQ and [http://blogs.dfwikilabs.org/moodle_ws/ DFWS Team].
| |
| | |
| The objective is to support multiple web service protocols (REST, SOAP, XML-RPC and AMF). Adding support for a new protocol should be relatively easy.
| |
| | |
| == How it works ==
| |
| This following example would work but it will not be the unique way to access web services. Please have a look to the [[External services security]] page for more details.
| |
| #The client sends a username and password to the web service protocol server script.
| |
| #The protocol server returns a session token for that user account (how this is sent depends on the protocol).
| |
| #The client calls a particular web service function including the session token.
| |
| #The protocol server uses the token to check that the web service session is still active.
| |
| #The protocol server call the matching external function, located in a externallib.php file inside the relevant module.
| |
| #The external function checks that the current user has_capability to do this operation.
| |
| #The external function calls the matching Moodle core function (in lib.php usually).
| |
| #The core function can return a result to the external function.
| |
| #The external function will return a result to the protocol server.
| |
| #The protocol server returns the result to the client.
| |
| | |
| ==Web description format==
| |
| | |
| All functions that can be called via web services can be declared in a db/service.php file and can be defined in an externallib.php file somewhere. The description of the functions that can be called, and what parameters they require, are explained in the [https://docs.moodle.org/en/Development:Web_services_description External Service description document].
| |
| | |
| ==Web services technical documentation==
| |
| In order to facilitate a Moodle web service client implementation, every Moodle sites will provide a page listing all function descriptions. This page also gives some useful advice for any supported protocol. To call this page: ''your_moodle/webservice/wsdoc.php?protocol=soap
| |
| ''
| |
| | |
| ==Authentication==
| |
| Please have a look to the [[External services security]] page
| |
| ==See also==
| |
| * [[External services security]]
| |
| * [[External services description]]
| |
| * [[Creating a web service and a web service function]]
| |
| * [[Creating a web service client]]
| |
| * [[Web_Services]]
| |
| | |
| [[Category:Web Services]]
| |