ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilAbstractSoapMethod.php
Go to the documentation of this file.
1<?php
2require_once(__DIR__ . '/ilSoapMethod.php');
3require_once(__DIR__ . '/class.ilSoapPluginException.php');
4require_once('./webservice/soap/classes/class.ilSoapAdministration.php');
5
16{
17 public function __construct()
18 {
19 parent::__construct(true);
20 }
21
25 public function getServiceStyle()
26 {
27 return 'rpc';
28 }
29
33 public function getServiceUse()
34 {
35 return 'encoded';
36 }
37
46 protected function initIliasAndCheckSession($session_id)
47 {
48 $this->initAuth($session_id);
49 $this->initIlias();
50 if (!$this->__checkSession($session_id)) {
51 throw new ilSoapPluginException($this->__getMessage());
52 }
53 }
54
61 protected function checkParameters(array $params)
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 }
70
81 public function __raiseError($a_message, $a_code)
82 {
83 throw new ilSoapPluginException($a_message, $a_code);
84 }
85}
An exception for terminatinating execution or to throw for unit testing.
Class ilAbstractSoapMethod.
getServiceStyle()
Get the service style, e.g.'rpc'string
getServiceUse()
Get the service use, e.g.'encoded'string
__raiseError($a_message, $a_code)
Overwrites the __raiseError method and transforms any raised errors into ilPluginExceptions.
checkParameters(array $params)
Check that all input parameters are present when executing the soap method.
initIliasAndCheckSession($session_id)
Use this method at the beginning of your execute() method to check if the provided session ID is vali...
initAuth($sid)
Init authentication.
Class ilSoapPluginException.
$i
Definition: disco.tpl.php:19
Interface ilSoapMethod.
getInputParams()
Get the input parameters.