Note:

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

Mnet Web services API: Difference between revisions

From MoodleDocs
No edit summary
Line 1: Line 1:
== Overview ==
== Overview ==
Please also see the discussion about a simple to use xml-rpc based api at [[Simple web services|simple web services]].


Provide Moodle with a web service interface to allow exchange of data and information with other systems.


Specifically,
The Web Services API provides Moodle with a web service interface to allow exchange of data and information with other systems.
 
For example,
# Manage user data - send and retrieve the information,
# Manage user data - send and retrieve the information,
# Manage course enrolments - add/remove teachers and students,
# Manage course enrolments - add/remove teachers and students,
Line 10: Line 10:
# Gradebook info - extract grades information from Moodle.
# Gradebook info - extract grades information from Moodle.


The API will be built in two tiers:
==XML-RPC background==
# Generic Moodle web services - This will define the API available to be used by specific protocols.
# Protocol-specific web services - Using the generic services as the parent, define specific interfaces for SOAP, XML-RPC and others.


'''Class Structure:'''<br>
==The server script==
Base class <code>server.class.php</code>:<br>
:This class provides most of the necessary functions to authenticate and communicate with Moodle. It also defines the methods that must be implemented by the protocol class. Any web service protocol class must:
:* call the base class constructor (<code>parent::init()</code>),
:* implement the main method (<code>main([$httpdata])</code>),
:* implement the request method (<code>request($input)</code>),
:* implement the reply method (<code>response($request)</code>).


Derived class (e.g. <code>soapserver.class.php</code>).
==Things you can do==


The driver for the whole operation is through <code>service.php</code>. It takes one argument, <code>type</code>, which contains a string identifying the protocol to use (e.g. 'soap').
==See also==
 
So, to call a SOAP based web service:<br>
<code>http://your.server.org/moodle/ws/server.php?type=soap</code>
The data for the entire operation comes through the POST mechanism.
 
== Manage User Data ==
These functions will allow the exchange of user data, and account management functions. Initial work will use the IMS Enterprise XML standard for data definition.
 
== Manage Course Enrolments ==
These functions will allow for student, teacher and group management functions within a course. Initial work will use the [http://moodle.cvs.sourceforge.net/*checkout*/moodle/moodle/lang/en_utf8/help/enrol/imsenterprise/formatoverview.html IMS Enterprise XML] standard for data definition.
 
== Manage Courses ==
These functions will allow for definition and management of courses. Initial work will use the IMS Enterprise XML standard for data definition.
 
== Manage Grades ==
These functions will allow for information about grades to be exchanged. Initial work will use the IMS Enterprise XML standard for data definition.


== Code ==
* Using Moodle [http://moodle.org/mod/forum/view.php?f=965 Web Services forum] 
The code is available in the contrib/patches/ws directory of cvs.
cvs -z3 -d:pserver:anonymous@moodle.cvs.sourceforge.net:/cvsroot/moodle co contrib/patches/ws


==See also==


* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=44079 Web Services in forthcoming Moodle] 
*forum discussions
**[http://moodle.org/mod/forum/discuss.php?d=51752 Proposal: Web Services / API / Refactoring Opportunity]
**[http://moodle.org/mod/forum/discuss.php?d=67947 OKTech Web Services]




[[Category:Administrator]]
[[Category:Administrator]]

Revision as of 20:58, 6 May 2007

Overview

The Web Services API provides Moodle with a web service interface to allow exchange of data and information with other systems.

For example,

  1. Manage user data - send and retrieve the information,
  2. Manage course enrolments - add/remove teachers and students,
  3. Course management - create new courses based on templates,
  4. Gradebook info - extract grades information from Moodle.

XML-RPC background

The server script

Things you can do

See also