Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Web services: Difference between revisions

From MoodleDocs
m (Protected "Web services": Developer Docs Migration ([Edit=Allow only administrators] (indefinite)))
 
(111 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{Template:Work in progress}}{{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 tracker issue is here: MDL-12886<br>
This module is been implemented by the [http://blogs.dfwikilabs.org/moodle_ws/ DFWS Team] and Moodle.
 
=Implementation=
Web Services module has been conceived in a purpose to be ported on different Moodle version, and also on different project. It has also for purpose to support multiple web service protocols (REST, SOAP, AMFPHP, ...). Adding a new protocol support should be relatively easy.
 
== How does it work ==
The web service client call a Moodle web service. The web service is located in a folder specific to the used protocol. It's usually a inout.php file. This file runs the web service server and gets the sent parameters. Then it calls a wrapper. The wrapper.php file is implemented in order to call the Moodle API which contains all callable functions. The wrapper will check a "generated file" in order to know which functions are available, and what their parameters and what they returned.<br>
For any protocol there should be at least one inout.php file and one wrapper file.
 
 
== Technical specs ==
# The client calls the web service
# The web service server receives the call
# The web service server transforms the web service params into a common param format to all web service protocol => Format to be defined
# The web service server calls a function call_moodle_function($functionname, $params)
# call_moodle_function() checks through a WS API descriptor class that the params are legal for this function name
# call_moodle_function() call the correct API moodle function
# the call_moodle_function() return the result to the web service server
# the web service server convert the result into a response
 
Params should include:
* function parameter names, values and types
* returned object fields (e.g. we cannot return a password field through a get_users function)
* return value and type
 
=Security=
How are the web services secured ?<br>
Security layer implemented by every protocol?
 
=List of functions=
All callable functions are declared into Moodle API, please read [https://docs.moodle.org/en/index.php?title=Development:Moodle_API Moodle API documentation].

Latest revision as of 06:13, 22 December 2022

Important:

This content of this page has been updated and migrated to the new Moodle Developer Resources. The information contained on the page should no longer be seen up-to-date.

Why not view this page on the new site and help us to migrate more content to the new site!