50 $this->use_wsdl =
true;
51 $timeout =
$ilSetting->get(
'soap_connect_timeout', self::DEFAULT_CONNECT_TIMEOUT);
53 $timeout = self::DEFAULT_CONNECT_TIMEOUT;
55 $this->connect_timeout = $timeout;
57 $this->response_timeout = self::DEFAULT_RESPONSE_TIMEOUT;
75 $this->connect_timeout = $a_timeout;
92 $this->response_timeout = (int) $a_timeout;
109 $this->use_wsdl = $a_stat;
118 return $this->use_wsdl;
132 if (strlen(trim(
$ilSetting->get(
'soap_wsdl_path',
'')))) {
133 $this->uri =
$ilSetting->get(
'soap_wsdl_path',
'');
139 $this->log->debug(
'Using wsdl: ' . $this->
getServer());
140 $this->log->debug(
'Using connection timeout: ' . $this->
getTimeout());
144 $this->client =
new SoapClient(
147 'exceptions' =>
true,
149 'connection_timeout' => (
int) $this->
getTimeout()
153 }
catch (SoapFault $ex) {
154 $this->log->warning(
'Soap init failed with message: ' . $ex->getMessage());
168 $this->stored_socket_timeout = ini_get(
'default_socket_timeout');
169 $this->log->debug(
'Default socket timeout is: ' . $this->stored_socket_timeout);
172 $this->log->debug(
'WSDL mode, using socket timeout: ' . $this->
getTimeout());
173 ini_set(
'default_socket_timeout', $this->
getTimeout());
175 $this->log->debug(
'Non WSDL mode, using socket timeout: ' . $this->
getResponseTimeout());
187 ini_set(
'default_socket_timeout', $this->stored_socket_timeout);
188 $this->log->debug(
'Restoring default socket timeout to: ' . $this->stored_socket_timeout);
197 public function call($a_operation, $a_params)
199 $this->log->debug(
'Calling webservice: ' . $a_operation);
203 return $this->client->__call($a_operation, $a_params);
204 }
catch (SoapFault $exception) {
205 $this->log->error(
'Calling webservice failed with message: ' . $exception->getMessage());
206 $this->log->debug($this->client->__getLastResponseHeaders());
207 $this->log->debug($this->client->__getLastResponse());
210 $this->log->error(
'Caught unknown exception with message: ' . $exception->getMessage());
211 $this->log->debug($this->client->__getLastResponseHeaders());
212 $this->log->debug($this->client->__getLastResponse());
call($a_operation, $a_params)
Call webservice method.
enableWSDL($a_stat)
enable wsdl mode
resetSocketTimeout()
Reset socket default timeout to defaults.
const DEFAULT_RESPONSE_TIMEOUT
setSocketTimeout($a_wsdl_mode)
Set socket timeout.
const DEFAULT_CONNECT_TIMEOUT
enabledWSDL()
Check if wsdl is enabled.
setTimeout($a_timeout)
Set connect timeout.
setResponseTimeout($a_timeout)
static getLogger($a_component_id)
Get component logger.
getServer()
Get server uri.
getTimeout()
Get connect timeout.