ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilAbstractSoapMethod.php
Go to the documentation of this file.
1 <?php
2 require_once(__DIR__ . '/ilSoapMethod.php');
3 require_once(__DIR__ . '/class.ilSoapPluginException.php');
4 require_once('./webservice/soap/classes/class.ilSoapAdministration.php');
5 
15 abstract class ilAbstractSoapMethod extends ilSoapAdministration implements ilSoapMethod
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 }
getServiceStyle()
Get the service style, e.g.&#39;rpc&#39;string
Class ilAbstractSoapMethod.
Interface ilSoapMethod.
Definition: ilSoapMethod.php:9
initIliasAndCheckSession($session_id)
Use this method at the beginning of your execute() method to check if the provided session ID is vali...
getServiceUse()
Get the service use, e.g.&#39;encoded&#39;string
checkParameters(array $params)
Check that all input parameters are present when executing the soap method.
getInputParams()
Get the input parameters.
initAuth($sid)
Init authentication.
$i
Definition: disco.tpl.php:19
__raiseError($a_message, $a_code)
Overwrites the __raiseError method and transforms any raised errors into ilPluginExceptions.
Class ilSoapPluginException.