ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAbstractSoapMethod Class Reference

Class ilAbstractSoapMethod. More...

+ Inheritance diagram for ilAbstractSoapMethod:
+ Collaboration diagram for ilAbstractSoapMethod:

Public Member Functions

 __construct ()
 
 getServiceStyle ()
 Get the service style, e.g.'rpc'
Returns
string
More...
 
 getServiceUse ()
 Get the service use, e.g.'encoded'
Returns
string
More...
 
 __raiseError ($a_message, $a_code)
 Overwrites the __raiseError method and transforms any raised errors into ilPluginExceptions. More...
 
- Public Member Functions inherited from ilSoapAdministration
 __construct ($use_nusoap=true)
 Constructor. More...
 
 initErrorWriter ()
 Overwrite error handler. More...
 
 __explodeSid ($sid)
 
 __setMessage ($a_str)
 
 __getMessage ()
 
 __appendMessage ($a_str)
 
 __setMessageCode ($a_code)
 
 __getMessageCode ()
 
 initAuth ($sid)
 Init authentication. More...
 
 initIlias ()
 
 __initAuthenticationObject ($a_auth_mode=AUTH_LOCAL)
 
 __raiseError ($a_message, $a_code)
 
 getNIC ($sid)
 get client information from current as xml result set More...
 
 isFault ($object)
 
 checkObjectAccess ($ref_id, $expected_type, $permission, $returnObject=false)
 check access for ref id: expected type, permission, return object instance if returnobject is true More...
 
 getInstallationInfoXML ()
 
 getClientInfoXML ($clientid)
 
- Public Member Functions inherited from ilSoapMethod
 getName ()
 Get the name of the method. More...
 
 getInputParams ()
 Get the input parameters. More...
 
 getOutputParams ()
 Get the output parameters in the same format as the input parameters. More...
 
 getServiceNamespace ()
 Get the namespace of the service where this method belongs to. More...
 
 getDocumentation ()
 Get the documentation of this method. More...
 
 execute (array $params)
 Execute the business logic for this SOAP method (when a SOAP request hits the endpoint defined by the name). More...
 

Protected Member Functions

 initIliasAndCheckSession ($session_id)
 Use this method at the beginning of your execute() method to check if the provided session ID is valid. More...
 
 checkParameters (array $params)
 Check that all input parameters are present when executing the soap method. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSoapAdministration
static return_bytes ($val)
 calculate bytes from K,M,G modifiers e.g: 8M = 8 * 1024 * 1024 bytes More...
 
- Data Fields inherited from ilSoapAdministration
 $sauth = null
 
 $error_method = null
 
- Protected Attributes inherited from ilSoapAdministration
 $soap_check = true
 

Detailed Description

Class ilAbstractSoapMethod.

Base class for soap methods of SoapHook plugins. Throw a ilSoapPluginException in your business logic in case of errors. The plugin hook catches these exceptions and returns the exception messages to the SOAP caller.

Author
Stefan Wanzenried sw@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 15 of file class.ilAbstractSoapMethod.php.

Constructor & Destructor Documentation

◆ __construct()

ilAbstractSoapMethod::__construct ( )

Definition at line 17 of file class.ilAbstractSoapMethod.php.

18  {
19  parent::__construct(true);
20  }

Member Function Documentation

◆ __raiseError()

ilAbstractSoapMethod::__raiseError (   $a_message,
  $a_code 
)

Overwrites the __raiseError method and transforms any raised errors into ilPluginExceptions.

Note: These exceptions will be caught by the plugin slot and and the exception message is returned to the SOAP caller.

Parameters
string$a_message
int$a_code
Exceptions
ilSoapPluginException
Returns
void

Definition at line 81 of file class.ilAbstractSoapMethod.php.

82  {
83  throw new ilSoapPluginException($a_message, $a_code);
84  }
Class ilSoapPluginException.

◆ checkParameters()

ilAbstractSoapMethod::checkParameters ( array  $params)
protected

Check that all input parameters are present when executing the soap method.

Parameters
array$params
Exceptions
ilSoapPluginException

Definition at line 61 of file class.ilAbstractSoapMethod.php.

References $i, $names, and ilSoapMethod\getInputParams().

62  {
63  for ($i = 0; $i < count($this->getInputParams()); $i++) {
64  if (!isset($params[$i])) {
65  $names = implode(', ', array_keys($this->getInputParams()));
66  throw new ilSoapPluginException("Request is missing at least one of the following parameters: $names");
67  }
68  }
69  }
$params
Definition: disable.php:11
getInputParams()
Get the input parameters.
$i
Definition: disco.tpl.php:19
Class ilSoapPluginException.
+ Here is the call graph for this function:

◆ getServiceStyle()

ilAbstractSoapMethod::getServiceStyle ( )

Get the service style, e.g.'rpc'

Returns
string

Implements ilSoapMethod.

Definition at line 25 of file class.ilAbstractSoapMethod.php.

26  {
27  return 'rpc';
28  }

◆ getServiceUse()

ilAbstractSoapMethod::getServiceUse ( )

Get the service use, e.g.'encoded'

Returns
string

Implements ilSoapMethod.

Definition at line 33 of file class.ilAbstractSoapMethod.php.

34  {
35  return 'encoded';
36  }

◆ initIliasAndCheckSession()

ilAbstractSoapMethod::initIliasAndCheckSession (   $session_id)
protected

Use this method at the beginning of your execute() method to check if the provided session ID is valid.

This method wraps around ilSoapAdministration::initAuth() and ilSoapAdministration::initILIAS() which are both required in order to handle the request.

Parameters
string$session_id
Exceptions
ilSoapPluginException

Definition at line 46 of file class.ilAbstractSoapMethod.php.

References ilSoapAdministration\__getMessage(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().

47  {
48  $this->initAuth($session_id);
49  $this->initIlias();
50  if (!$this->__checkSession($session_id)) {
51  throw new ilSoapPluginException($this->__getMessage());
52  }
53  }
initAuth($sid)
Init authentication.
Class ilSoapPluginException.
+ Here is the call graph for this function:

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