Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
webservice_soap_server Class Reference

SOAP service server implementation. More...

Inheritance diagram for webservice_soap_server:

Public Member Functions

 __construct ($authmethod)
 Contructor.
 
 fault ($fault=null, $code='Receiver')
 Generate a server fault.
 
 run ()
 Runs the SOAP web service.
 

Protected Member Functions

 generate_wsdl ()
 Generates the WSDL.
 
 handle ()
 Handles the web service function call.
 
 parse_request ()
 This method parses the $_POST and $_GET superglobals and looks for the following information:
 
 send_error ($ex=null)
 Send the error information to the WS client formatted as an XML document.
 
 send_headers ()
 Internal implementation - sending of page headers.
 
 send_response ()
 Send the result of function call to the WS client.
 

Protected Attributes

string $response
 The response.
 
moodle_url $serverurl
 The server URL.
 
string $serviceclass
 The class name of the virtual class generated for this web service.
 
SoapServer $soapserver
 The Soap.
 
webservice_soap wsdl $wsdl
 The object for WSDL generation.
 
bool $wsdlmode
 WSDL mode flag.
 

Detailed Description

SOAP service server implementation.

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

Constructor & Destructor Documentation

◆ __construct()

webservice_soap_server::__construct ( $authmethod)

Contructor.

Parameters
string$authmethodauthentication method of the web service (WEBSERVICE_AUTHMETHOD_PERMANENT_TOKEN, ...)

Member Function Documentation

◆ fault()

webservice_soap_server::fault ( $fault = null,
$code = 'Receiver' )

Generate a server fault.

Note that the parameter order is the reverse of SoapFault's constructor parameters.

Moodle note: basically we return the faultactor (errorcode) and faultdetails (debuginfo).

If an exception is passed as the first argument, its message and code will be used to create the fault object.

@externalurl http://www.w3.org/TR/soap12-part1/#faultcodes

Parameters
string | Exception$fault
string$codeSOAP Fault Codes

◆ parse_request()

webservice_soap_server::parse_request ( )
protected

This method parses the $_POST and $_GET superglobals and looks for the following information:

  • User authentication parameters:
    • Username + password (wsusername and wspassword), or
    • Token (wstoken)

◆ run()

webservice_soap_server::run ( )

Runs the SOAP web service.

Exceptions
coding_exception
moodle_exception
webservice_access_exception

◆ send_error()

webservice_soap_server::send_error ( $ex = null)
protected

Send the error information to the WS client formatted as an XML document.

Parameters
Exception$exthe exception to send back

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