ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
- Public Member Functions inherited from ilSoapAdministration
 __construct (bool $use_nusoap=true)
 
 getMessage ()
 
 appendMessage (string $a_str)
 
 setMessageCode (string $a_code)
 
 getMessageCode ()
 
 reInitUser ()
 
 isFault ($object)
 
 getInstallationInfoXML ()
 
 getClientInfoXML (string $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 (string $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...
 
 raiseError (string $a_message, $a_code)
 Overwrites the __raiseError method and transforms any raised errors into ilPluginExceptions. More...
 
- Protected Member Functions inherited from ilSoapAdministration
 checkSession (string $sid)
 
 explodeSid (string $sid)
 
 setMessage (string $a_str)
 
 initAuth (string $sid)
 
 initIlias ()
 
 initAuthenticationObject ()
 
 raiseError (string $a_message, $a_code)
 
 checkObjectAccess (int $ref_id, array $expected_type, string $permission, bool $returnObject=false)
 check access for ref id: expected type, permission, return object instance if returnobject is true More...
 

Additional Inherited Members

- Data Fields inherited from ilSoapAdministration
const NUSOAP = 1
 
const PHP5 = 2
 
int $error_method
 Defines type of error handling (PHP5 || NUSOAP) More...
 
- Protected Attributes inherited from ilSoapAdministration
bool $soap_check = true
 
string $message = ''
 
string $message_code = ''
 

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 30 of file class.ilAbstractSoapMethod.php.

Constructor & Destructor Documentation

◆ __construct()

ilAbstractSoapMethod::__construct ( )

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

References ILIAS\GlobalScreen\Provider\__construct().

33  {
34  parent::__construct(true);
35  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ 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 76 of file class.ilAbstractSoapMethod.php.

References $i, and ilSoapMethod\getInputParams().

76  : void
77  {
78  for ($i = 0, $iMax = count($this->getInputParams()); $i < $iMax; $i++) {
79  if (!isset($params[$i])) {
80  $names = implode(', ', array_keys($this->getInputParams()));
81  throw new ilSoapPluginException("Request is missing at least one of the following parameters: $names");
82  }
83  }
84  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
getInputParams()
Get the input parameters.
$i
Definition: metadata.php:41
+ 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 40 of file class.ilAbstractSoapMethod.php.

40  : string
41  {
42  return 'rpc';
43  }

◆ getServiceUse()

ilAbstractSoapMethod::getServiceUse ( )

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

Returns
string

Implements ilSoapMethod.

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

48  : string
49  {
50  return 'encoded';
51  }

◆ initIliasAndCheckSession()

ilAbstractSoapMethod::initIliasAndCheckSession ( string  $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 61 of file class.ilAbstractSoapMethod.php.

References ilSoapAdministration\checkSession(), ilSoapAdministration\getMessage(), ilSoapAdministration\initAuth(), and ilSoapAdministration\reInitUser().

61  : void
62  {
63  $this->initAuth($session_id);
64  $this->reInitUser();
65  if (!$this->checkSession($session_id)) {
66  throw new ilSoapPluginException($this->getMessage());
67  }
68  }
+ Here is the call graph for this function:

◆ raiseError()

ilAbstractSoapMethod::raiseError ( string  $a_message,
  $a_code 
)
protected

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
string | int$a_code
Returns
void
Exceptions
ilSoapPluginException

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

96  {
97  throw new ilSoapPluginException($a_message, $a_code);
98  }

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