Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
webservice_xmlrpc_client Class Reference

Moodle XML-RPC client. More...

Public Member Functions

 __construct ($serverurl, $token)
 Constructor. More...
 
 call ($functionname, $params=array())
 Execute client WS request with token authentication. More...
 
 set_token ($token)
 Set the token used to do the XML-RPC call. More...
 

Protected Member Functions

 decode_response ($response)
 Parses and decodes the response XML. More...
 
 encode_request ($functionname, $params)
 Generates XML for a method request. More...
 

Protected Attributes

moodle_url $serverurl
 The XML-RPC server url.
 
string $token
 The token for the XML-RPC call.
 

Detailed Description

Moodle XML-RPC client.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

webservice_xmlrpc_client::__construct (   $serverurl,
  $token 
)

Constructor.

Parameters
string$serverurla Moodle URL
string$tokenthe token used to do the web service call

Member Function Documentation

◆ call()

webservice_xmlrpc_client::call (   $functionname,
  $params = array() 
)

Execute client WS request with token authentication.

Parameters
string$functionnamethe function name
array$paramsAn associative array containing the the parameters of the function being called.
Return values
mixedThe decoded XML RPC response.
Exceptions
moodle_exception

◆ decode_response()

webservice_xmlrpc_client::decode_response (   $response)
protected

Parses and decodes the response XML.

Parameters
string$response
Return values
array

◆ encode_request()

webservice_xmlrpc_client::encode_request (   $functionname,
  $params 
)
protected

Generates XML for a method request.

Parameters
string$functionnameName of the method to call.
mixed$paramsMethod parameters compatible with the method signature.
Return values
string

◆ set_token()

webservice_xmlrpc_client::set_token (   $token)

Set the token used to do the XML-RPC call.

Parameters
string$tokenthe token used to do the web service call

The documentation for this class was generated from the following file: