ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSoapClient Class Reference
+ Collaboration diagram for ilSoapClient:

Public Member Functions

 ilSoapClient ($a_server='')
 
 __setServer ($a_server)
 
 getServer ()
 
 setTimeout ($a_timeout)
 
 getTimeout ()
 
 setResponseTimeout ($a_timeout)
 
 getResponseTimeout ()
 
 enableWSDL ($a_status)
 
 enabledWSDL ()
 
 init ()
 
call ($a_operation, $a_params)
 

Data Fields

const DEFAULT_CONNECT_TIMEOUT = 10
 
const DEFAULT_RESPONSE_TIMEOUT = 5
 
 $server = ''
 
 $timeout = null
 
 $response_timeout = null
 
 $use_wsdl = true
 

Detailed Description

Definition at line 40 of file class.ilSoapClient.php.

Member Function Documentation

◆ __setServer()

ilSoapClient::__setServer (   $a_server)

Definition at line 58 of file class.ilSoapClient.php.

References $ilSetting, ilUtil\_getHttpPath(), and setTimeout().

Referenced by ilSoapClient().

59  {
60  global $ilSetting;
61 
62  if(strlen($a_server))
63  {
64  return $this->server = $a_server;
65  }
66 
67  if(strlen(trim($ilSetting->get('soap_wsdl_path'))))
68  {
69  return $this->server = trim($ilSetting->get('soap_wsdl_path'));
70  }
71 
72  $this->setTimeout($ilSetting->get('soap_connect_timeout', self::DEFAULT_CONNECT_TIMEOUT));
73 
74  $this->server = ilUtil::_getHttpPath().'/webservice/soap/server.php?wsdl';
75  }
setTimeout($a_timeout)
static _getHttpPath()
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ call()

& ilSoapClient::call (   $a_operation,
  $a_params 
)

Definition at line 131 of file class.ilSoapClient.php.

References $res, and getServer().

132  {
133  $res = $this->client->call($a_operation,$a_params);
134 
135  #$GLOBALS['ilLog']->write(__METHOD__.': '.$this->client->request);
136  #$GLOBALS['ilLog']->write(__METHOD__.': '.$this->client->response);
137 
138  if($error = $this->client->getError())
139  {
140  if(stristr($error, 'socket read of headers') === FALSE)
141  {
142  $this->log->write('Error calling soap server: '.$this->getServer().' Error: '.$error);
143  }
144  }
145 
146  return $res;
147  // Todo cannot check errors here since it's not possible to distinguish between 'timeout' and other errors.
148  }
+ Here is the call graph for this function:

◆ enabledWSDL()

ilSoapClient::enabledWSDL ( )

Definition at line 104 of file class.ilSoapClient.php.

References $use_wsdl.

Referenced by init().

105  {
106  return (bool) $this->use_wsdl;
107  }
+ Here is the caller graph for this function:

◆ enableWSDL()

ilSoapClient::enableWSDL (   $a_status)

Definition at line 100 of file class.ilSoapClient.php.

101  {
102  $this->use_wsdl = (bool) $a_status;
103  }

◆ getResponseTimeout()

ilSoapClient::getResponseTimeout ( )

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

References $response_timeout.

Referenced by init().

96  {
98  }
+ Here is the caller graph for this function:

◆ getServer()

ilSoapClient::getServer ( )

Definition at line 77 of file class.ilSoapClient.php.

References $server.

Referenced by call(), and init().

78  {
79  return $this->server;
80  }
+ Here is the caller graph for this function:

◆ getTimeout()

ilSoapClient::getTimeout ( )

Definition at line 86 of file class.ilSoapClient.php.

Referenced by init().

87  {
88  return $this->timeout ? $this->timeout : self::DEFAULT_CONNECT_TIMEOUT;
89  }
+ Here is the caller graph for this function:

◆ ilSoapClient()

ilSoapClient::ilSoapClient (   $a_server = '')

Definition at line 50 of file class.ilSoapClient.php.

References $ilLog, and __setServer().

51  {
52  global $ilLog;
53 
54  $this->log =& $ilLog;
55  $this->__setServer($a_server);
56  }
__setServer($a_server)
+ Here is the call graph for this function:

◆ init()

ilSoapClient::init ( )

Definition at line 109 of file class.ilSoapClient.php.

References enabledWSDL(), getResponseTimeout(), getServer(), and getTimeout().

110  {
111  $this->client = new nusoap_client($this->getServer(),
112  $this->enabledWSDL(),
113  false, // no proxy support in the moment
114  false,
115  false,
116  false,
117  $this->getTimeout(),
118  $this->getResponseTimeout());
119 
120  if($error = $this->client->getError())
121  {
122  if(stristr($error, 'socket read of headers') === FALSE)
123  {
124  $this->log->write('Error calling soap server: '.$this->getServer().' Error: '.$error);
125  }
126  return false;
127  }
128  return true;
129  }
[nu]soapclient higher level class for easy usage.
Definition: nusoap.php:7059
+ Here is the call graph for this function:

◆ setResponseTimeout()

ilSoapClient::setResponseTimeout (   $a_timeout)

Definition at line 91 of file class.ilSoapClient.php.

92  {
93  $this->response_timeout = $a_timeout;
94  }

◆ setTimeout()

ilSoapClient::setTimeout (   $a_timeout)

Definition at line 82 of file class.ilSoapClient.php.

Referenced by __setServer().

83  {
84  $this->timeout = $a_timeout;
85  }
+ Here is the caller graph for this function:

Field Documentation

◆ $response_timeout

ilSoapClient::$response_timeout = null

Definition at line 47 of file class.ilSoapClient.php.

Referenced by getResponseTimeout().

◆ $server

ilSoapClient::$server = ''

Definition at line 45 of file class.ilSoapClient.php.

Referenced by getServer().

◆ $timeout

ilSoapClient::$timeout = null

Definition at line 46 of file class.ilSoapClient.php.

◆ $use_wsdl

ilSoapClient::$use_wsdl = true

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

Referenced by enabledWSDL().

◆ DEFAULT_CONNECT_TIMEOUT

const ilSoapClient::DEFAULT_CONNECT_TIMEOUT = 10

Definition at line 42 of file class.ilSoapClient.php.

Referenced by ilObjSystemFolderGUI\initWebServicesForm().

◆ DEFAULT_RESPONSE_TIMEOUT

const ilSoapClient::DEFAULT_RESPONSE_TIMEOUT = 5

Definition at line 43 of file class.ilSoapClient.php.


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