ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAbstractSoapMethod.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
31{
32 public function __construct()
33 {
35 }
36
40 public function getServiceStyle(): string
41 {
42 return 'rpc';
43 }
44
48 public function getServiceUse(): string
49 {
50 return 'encoded';
51 }
52
61 protected function initIliasAndCheckSession(string $session_id): void
62 {
63 $this->initAuth($session_id);
64 $this->reInitUser();
65 if (!$this->checkSession($session_id)) {
66 throw new ilSoapPluginException($this->getMessage());
67 }
68 }
69
76 protected function checkParameters(array $params): 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 }
85
95 protected function raiseError(string $a_message, $a_code)
96 {
97 throw new ilSoapPluginException($a_message, $a_code);
98 }
99}
Class ilAbstractSoapMethod.
getServiceStyle()
Get the service style, e.g.'rpc' string
getServiceUse()
Get the service use, e.g.'encoded' string
raiseError(string $a_message, $a_code)
Overwrites the __raiseError method and transforms any raised errors into ilPluginExceptions.
initIliasAndCheckSession(string $session_id)
Use this method at the beginning of your execute() method to check if the provided session ID is vali...
checkParameters(array $params)
Check that all input parameters are present when executing the soap method.
Class ilSoapPluginException.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInputParams()
Get the input parameters.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc