Moodle  2.2.1
http://www.collinsharper.com
webservice_rest_server Class Reference
Inheritance diagram for webservice_rest_server:
Collaboration diagram for webservice_rest_server:

Public Member Functions

 __construct ($authmethod, $restformat= 'xml')

Protected Member Functions

 parse_request ()
 send_response ()
 send_error ($ex=null)
 generate_error ($ex)
 send_headers ()

Static Protected Member Functions

static xmlize_result ($returns, $desc)

Protected Attributes

 $restformat

Detailed Description

REST service server implementation.

Author:
Petr Skoda (skodak)

Definition at line 32 of file locallib.php.


Constructor & Destructor Documentation

__construct ( authmethod,
restformat = 'xml' 
)

Contructor

Definition at line 40 of file locallib.php.


Member Function Documentation

generate_error ( ex) [protected]

Build the error information matching the REST returned value format (JSON or XML)

Parameters:
exception$ex
Returns:
string the error in the requested REST format

Definition at line 137 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

parse_request ( ) [protected]

This method parses the $_POST and $_GET superglobals and looks for the following information: 1/ user authentication - username+password or token (wsusername, wspassword and wstoken parameters) 2/ function name (wsfunction parameter) 3/ function parameters (all other parameters except those above)

Returns:
void

Reimplemented from webservice_base_server.

Definition at line 55 of file locallib.php.

send_error ( ex = null) [protected]

Send the error information to the WS client formatted as XML document. Note: the exception is never passed as null, it only matches the abstract function declaration.

Parameters:
exception$ex
Returns:
void

Reimplemented from webservice_base_server.

Definition at line 127 of file locallib.php.

Here is the call graph for this function:

send_headers ( ) [protected]

Internal implementation - sending of page headers.

Returns:
void

Definition at line 162 of file locallib.php.

Here is the caller graph for this function:

send_response ( ) [protected]

Send the result of function call to the WS client formatted as XML document.

Returns:
void

Reimplemented from webservice_base_server.

Definition at line 88 of file locallib.php.

Here is the call graph for this function:

static xmlize_result ( returns,
desc 
) [static, protected]

Internal implementation - recursive function producing XML markup.

Parameters:
mixed$returns
$desc
Returns:
unknown_type

Definition at line 181 of file locallib.php.

Here is the caller graph for this function:


Field Documentation

$restformat [protected]

Definition at line 35 of file locallib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations