ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
nusoap_client Class Reference

[nu]soapclient higher level class for easy usage. More...

+ Inheritance diagram for nusoap_client:
+ Collaboration diagram for nusoap_client:

Public Member Functions

 __construct ($endpoint, $wsdl=false, $proxyhost=false, $proxyport=false, $proxyusername=false, $proxypassword=false, $timeout=0, $response_timeout=30)
 constructor More...
 
 call ($operation, $params=array(), $namespace='http://tempuri.org', $soapAction='', $headers=false, $rpcParams=null, $style='rpc', $use='encoded')
 calls method, returns PHP native type More...
 
 checkWSDL ()
 check WSDL passed as an instance or pulled from an endpoint More...
 
 loadWSDL ()
 instantiate wsdl object and parse wsdl file More...
 
 getOperationData ($operation)
 get available data pertaining to an operation More...
 
 send ($msg, $soapaction='', $timeout=0, $response_timeout=30)
 send the SOAP message More...
 
 parseResponse ($headers, $data)
 processes SOAP message returned from server More...
 
 setCurlOption ($option, $value)
 sets user-specified cURL options More...
 
 setEndpoint ($endpoint)
 sets the SOAP endpoint, which can override WSDL More...
 
 setHeaders ($headers)
 set the SOAP headers More...
 
 getHeaders ()
 get the SOAP response headers (namespace resolution incomplete) More...
 
 getHeader ()
 get the SOAP response Header (parsed) More...
 
 setHTTPProxy ($proxyhost, $proxyport, $proxyusername='', $proxypassword='')
 set proxy info here More...
 
 setCredentials ($username, $password, $authtype='basic', $certRequest=array())
 if authenticating, set user credentials here More...
 
 setHTTPEncoding ($enc='gzip, deflate')
 use HTTP encoding More...
 
 setUseCURL ($use)
 Set whether to try to use cURL connections if possible. More...
 
 useHTTPPersistentConnection ()
 use HTTP persistent connections if possible More...
 
 getDefaultRpcParams ()
 gets the default RPC parameter setting. More...
 
 setDefaultRpcParams ($rpcParams)
 sets the default RPC parameter setting. More...
 
 getProxy ()
 dynamically creates an instance of a proxy class, allowing user to directly call methods from wsdl More...
 
 _getProxyClassCode ($r)
 dynamically creates proxy class code More...
 
 getProxyClassCode ()
 dynamically creates proxy class code More...
 
 getHTTPBody ($soapmsg)
 gets the HTTP body for the current request. More...
 
 getHTTPContentType ()
 gets the HTTP content type for the current request. More...
 
 getHTTPContentTypeCharset ()
 gets the HTTP content type charset for the current request. More...
 
 decodeUTF8 ($bool)
 
 setCookie ($name, $value)
 adds a new Cookie into $this->cookies array More...
 
 getCookies ()
 gets all Cookies More...
 
 checkCookies ()
 checks all Cookies and delete those which are expired More...
 
 UpdateCookies ($cookies)
 updates the current cookies with a new set More...
 
- Public Member Functions inherited from nusoap_base
 __construct ()
 constructor More...
 
 getGlobalDebugLevel ()
 gets the global debug level, which applies to future instances More...
 
 setGlobalDebugLevel ($level)
 sets the global debug level, which applies to future instances More...
 
 getDebugLevel ()
 gets the debug level for this instance More...
 
 setDebugLevel ($level)
 sets the debug level for this instance More...
 
 debug ($string)
 adds debug data to the instance debug string with formatting More...
 
 appendDebug ($string)
 adds debug data to the instance debug string without formatting More...
 
 clearDebug ()
 clears the current debug data for this instance More...
 
getDebug ()
 gets the current debug data for this instance More...
 
getDebugAsXMLComment ()
 gets the current debug data for this instance as an XML comment this may change the contents of the debug data More...
 
 expandEntities ($val)
 expands entities, e.g. More...
 
 getError ()
 returns error string if present More...
 
 setError ($str)
 sets error string More...
 
 isArraySimpleOrStruct ($val)
 detect if array is a simple array or a struct (associative array) More...
 
 serialize_val ($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded', $soapval=false)
 serializes PHP values in accordance w/ section 5. More...
 
 serializeEnvelope ($body, $headers=false, $namespaces=array(), $style='rpc', $use='encoded', $encodingStyle='http://schemas.xmlsoap.org/soap/encoding/')
 serializes a message More...
 
 formatDump ($str)
 formats a string to be inserted into an HTML stream More...
 
 contractQname ($qname)
 contracts (changes namespace to prefix) a qualified name More...
 
 expandQname ($qname)
 expands (changes prefix to namespace) a qualified name More...
 
 getLocalPart ($str)
 returns the local part of a prefixed string returns the original string, if not prefixed More...
 
 getPrefix ($str)
 returns the prefix part of a prefixed string returns false, if not prefixed More...
 
 getNamespaceFromPrefix ($prefix)
 pass it a prefix, it returns a namespace More...
 
 getPrefixFromNamespace ($ns)
 returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace More...
 
 getmicrotime ()
 returns the time in ODBC canonical form with microseconds More...
 
 varDump ($data)
 Returns a string with the output of var_dump. More...
 
 __toString ()
 represents the object as a string More...
 

Data Fields

 $return
 
 $wsdl
 
 $wsdlFile
 
 $opData
 
 $operation
 
 $username = ''
 
 $password = ''
 
 $authtype = ''
 
 $certRequest = array()
 
 $requestHeaders = false
 
 $responseHeaders = ''
 
 $responseHeader = null
 
 $document = ''
 
 $endpoint
 
 $forceEndpoint = ''
 
 $proxyhost = ''
 
 $proxyport = ''
 
 $proxyusername = ''
 
 $proxypassword = ''
 
 $xml_encoding = ''
 
 $http_encoding = false
 
 $timeout = 0
 
 $response_timeout = 30
 
 $endpointType = ''
 
 $persistentConnection = false
 
 $defaultRpcParams = false
 
 $request = ''
 
 $response = ''
 
 $responseData = ''
 
 $cookies = array()
 
 $decode_utf8 = true
 
 $operations = array()
 
 $curl_options = array()
 
 $bindingType = ''
 
 $use_curl = false
 
 $fault
 
 $faultcode
 
 $faultstring
 
 $faultdetail
 
- Data Fields inherited from nusoap_base
 $title = 'NuSOAP'
 
 $version = '0.7.3'
 
 $revision = '$Revision$'
 
 $error_str = ''
 
 $debug_str = ''
 
 $charencoding = true
 
 $debugLevel
 
 $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'
 
 $soap_defencoding = 'UTF-8'
 
 $namespaces
 
 $usedNamespaces = array()
 
 $typemap
 
 $xmlEntities
 

Detailed Description

[nu]soapclient higher level class for easy usage.

usage:

// instantiate client with server info $soapclient = new nusoap_client( string path [ ,mixed wsdl] );

// call method, get results echo $soapclient->call( string methodname [ ,array parameters] );

// bye bye client unset($soapclient);

Author
Dietrich Ayala dietr.nosp@m.ich@.nosp@m.ganx4.nosp@m..com
Scott Nichol snich.nosp@m.ol@u.nosp@m.sers..nosp@m.sour.nosp@m.cefor.nosp@m.ge.n.nosp@m.et
Version
$Id$ public

Definition at line 7182 of file nusoap.php.

Constructor & Destructor Documentation

◆ __construct()

nusoap_client::__construct (   $endpoint,
  $wsdl = false,
  $proxyhost = false,
  $proxyport = false,
  $proxyusername = false,
  $proxypassword = false,
  $timeout = 0,
  $response_timeout = 30 
)

constructor

Parameters
mixed$endpointSOAP server or WSDL URL (string), or wsdl instance (object)
bool$wsdloptional, set to true if using WSDL
int$portNameoptional portName in WSDL document
string$proxyhost
string$proxyport
string$proxyusername
string$proxypassword
integer$timeoutset the connection timeout
integer$response_timeoutset the response timeout public

Definition at line 7258 of file nusoap.php.

References ILIAS\GlobalScreen\Provider\__construct(), nusoap_base\appendDebug(), nusoap_base\debug(), null, and nusoap_base\varDump().

7259  {
7261  $this->endpoint = $endpoint;
7262  $this->proxyhost = $proxyhost;
7263  $this->proxyport = $proxyport;
7264  $this->proxyusername = $proxyusername;
7265  $this->proxypassword = $proxypassword;
7266  $this->timeout = $timeout;
7267  $this->response_timeout = $response_timeout;
7268 
7269  $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
7270  $this->appendDebug('endpoint=' . $this->varDump($endpoint));
7271 
7272  // make values
7273  if ($wsdl) {
7274  if (is_object($endpoint) && (get_class($endpoint) == 'wsdl')) {
7275  $this->wsdl = $endpoint;
7276  $this->endpoint = $this->wsdl->wsdl;
7277  $this->wsdlFile = $this->endpoint;
7278  $this->debug('existing wsdl instance created from ' . $this->endpoint);
7279  $this->checkWSDL();
7280  } else {
7281  $this->wsdlFile = $this->endpoint;
7282  $this->wsdl = null;
7283  $this->debug('will use lazy evaluation of wsdl from ' . $this->endpoint);
7284  }
7285  $this->endpointType = 'wsdl';
7286  } else {
7287  $this->debug("instantiate SOAP with endpoint at $endpoint");
7288  $this->endpointType = 'soap';
7289  }
7290  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
parses a WSDL file, allows access to it's data, other utility methods.
Definition: nusoap.php:4587
checkWSDL()
check WSDL passed as an instance or pulled from an endpoint
Definition: nusoap.php:7501
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:867
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getProxyClassCode()

nusoap_client::_getProxyClassCode (   $r)

dynamically creates proxy class code

Returns
string PHP/NuSOAP code for the proxy class private

Definition at line 7918 of file nusoap.php.

References $r, nusoap_base\appendDebug(), nusoap_base\debug(), nusoap_base\getError(), nusoap_base\setError(), and nusoap_base\varDump().

7919  {
7920  $this->debug("in getProxy endpointType=$this->endpointType");
7921  $this->appendDebug("wsdl=" . $this->varDump($this->wsdl));
7922  if ($this->endpointType != 'wsdl') {
7923  $evalStr = 'A proxy can only be created for a WSDL client';
7924  $this->setError($evalStr);
7925  $evalStr = "echo \"$evalStr\";";
7926  return $evalStr;
7927  }
7928  if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
7929  $this->loadWSDL();
7930  if ($this->getError()) {
7931  return "echo \"" . $this->getError() . "\";";
7932  }
7933  }
7934  $evalStr = '';
7935  foreach ($this->operations as $operation => $opData) {
7936  if ($operation != '') {
7937  // create param string and param comment string
7938  if (sizeof($opData['input']['parts']) > 0) {
7939  $paramStr = '';
7940  $paramArrayStr = '';
7941  $paramCommentStr = '';
7942  foreach ($opData['input']['parts'] as $name => $type) {
7943  $paramStr .= "\$$name, ";
7944  $paramArrayStr .= "'$name' => \$$name, ";
7945  $paramCommentStr .= "$type \$$name, ";
7946  }
7947  $paramStr = substr($paramStr, 0, strlen($paramStr) - 2);
7948  $paramArrayStr = substr($paramArrayStr, 0, strlen($paramArrayStr) - 2);
7949  $paramCommentStr = substr($paramCommentStr, 0, strlen($paramCommentStr) - 2);
7950  } else {
7951  $paramStr = '';
7952  $paramArrayStr = '';
7953  $paramCommentStr = 'void';
7954  }
7955  $opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace'];
7956  $evalStr .= "// $paramCommentStr
7957  function " . str_replace('.', '__', $operation) . "($paramStr) {
7958  \$params = array($paramArrayStr);
7959  return \$this->call('$operation', \$params, '" . $opData['namespace'] . "', '" . (isset($opData['soapAction']) ? $opData['soapAction'] : '') . "');
7960  }
7961  ";
7962  unset($paramStr);
7963  unset($paramCommentStr);
7964  }
7965  }
7966  $evalStr = 'class nusoap_proxy_' . $r . ' extends nusoap_client {
7967  ' . $evalStr . '
7968 }';
7969  return $evalStr;
7970  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
setError($str)
sets error string
Definition: nusoap.php:353
parses a WSDL file, allows access to it's data, other utility methods.
Definition: nusoap.php:4587
getError()
returns error string if present
Definition: nusoap.php:339
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:867
loadWSDL()
instantiate wsdl object and parse wsdl file
Definition: nusoap.php:7528
$r
+ Here is the call graph for this function:

◆ call()

nusoap_client::call (   $operation,
  $params = array(),
  $namespace = 'http://tempuri.org',
  $soapAction = '',
  $headers = false,
  $rpcParams = null,
  $style = 'rpc',
  $use = 'encoded' 
)

calls method, returns PHP native type

Parameters
string$operationSOAP server URL or path
mixed$paramsAn array, associative or simple, of the parameters for the method call, or a string that is the XML for the call. For rpc style, this call will wrap the XML in a tag named after the method, as well as the SOAP Envelope and Body. For document style, this will only wrap with the Envelope and Body. IMPORTANT: when using an array with document style, in which case there is really one parameter, the root of the fragment used in the call, which encloses what programmers normally think of parameters. A parameter array must include the wrapper.
string$namespaceoptional method namespace (WSDL can override)
string$soapActionoptional SOAPAction value (WSDL can override)
mixed$headersoptional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array
boolean$rpcParamsoptional (no longer used)
string$styleoptional (rpc|document) the style to use when serializing parameters (WSDL can override)
string$useoptional (encoded|literal) the use when serializing parameters (WSDL can override)
Returns
mixed response from SOAP call public

Definition at line 7317 of file nusoap.php.

References $namespace, $params, $payload, nusoap_base\$usedNamespaces, nusoap_base\appendDebug(), nusoap_base\clearDebug(), nusoap_base\debug(), nusoap_base\getDebug(), nusoap_base\getError(), nusoap_base\getPrefixFromNamespace(), send(), nusoap_base\serialize_val(), nusoap_base\serializeEnvelope(), wsdl\serializeRPCParameters(), nusoap_base\setError(), and nusoap_base\varDump().

7317  ://tempuri.org', $soapAction = '', $headers = false, $rpcParams = null, $style = 'rpc', $use = 'encoded')
7318  {
7319  $this->operation = $operation;
7320  $this->fault = false;
7321  $this->setError('');
7322  $this->request = '';
7323  $this->response = '';
7324  $this->responseData = '';
7325  $this->faultstring = '';
7326  $this->faultcode = '';
7327  $this->opData = array();
7328 
7329  $this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType");
7330  $this->appendDebug('params=' . $this->varDump($params));
7331  $this->appendDebug('headers=' . $this->varDump($headers));
7332  if ($headers) {
7333  $this->requestHeaders = $headers;
7334  }
7335  if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
7336  $this->loadWSDL();
7337  if ($this->getError()) {
7338  return false;
7339  }
7340  }
7341  // serialize parameters
7342  if ($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)) {
7343  // use WSDL for operation
7344  $this->opData = $opData;
7345  $this->debug("found operation");
7346  $this->appendDebug('opData=' . $this->varDump($opData));
7347  if (isset($opData['soapAction'])) {
7348  $soapAction = $opData['soapAction'];
7349  }
7350  if (! $this->forceEndpoint) {
7351  $this->endpoint = $opData['endpoint'];
7352  } else {
7353  $this->endpoint = $this->forceEndpoint;
7354  }
7355  $namespace = isset($opData['input']['namespace']) ? $opData['input']['namespace'] : $namespace;
7356  $style = $opData['style'];
7357  $use = $opData['input']['use'];
7358  // add ns to ns array
7359  if ($namespace != '' && !isset($this->wsdl->namespaces[$namespace])) {
7360  $nsPrefix = 'ns' . rand(1000, 9999);
7361  $this->wsdl->namespaces[$nsPrefix] = $namespace;
7362  }
7363  $nsPrefix = $this->wsdl->getPrefixFromNamespace($namespace);
7364  // serialize payload
7365  if (is_string($params)) {
7366  $this->debug("serializing param string for WSDL operation $operation");
7367  $payload = $params;
7368  } elseif (is_array($params)) {
7369  $this->debug("serializing param array for WSDL operation $operation");
7370  $payload = $this->wsdl->serializeRPCParameters($operation, 'input', $params, $this->bindingType);
7371  } else {
7372  $this->debug('params must be array or string');
7373  $this->setError('params must be array or string');
7374  return false;
7375  }
7376  $usedNamespaces = $this->wsdl->usedNamespaces;
7377  if (isset($opData['input']['encodingStyle'])) {
7378  $encodingStyle = $opData['input']['encodingStyle'];
7379  } else {
7380  $encodingStyle = '';
7381  }
7382  $this->appendDebug($this->wsdl->getDebug());
7383  $this->wsdl->clearDebug();
7384  if ($errstr = $this->wsdl->getError()) {
7385  $this->debug('got wsdl error: ' . $errstr);
7386  $this->setError('wsdl error: ' . $errstr);
7387  return false;
7388  }
7389  } elseif ($this->endpointType == 'wsdl') {
7390  // operation not in WSDL
7391  $this->appendDebug($this->wsdl->getDebug());
7392  $this->wsdl->clearDebug();
7393  $this->setError('operation ' . $operation . ' not present.');
7394  $this->debug("operation '$operation' not present.");
7395  return false;
7396  } else {
7397  // no WSDL
7398  //$this->namespaces['ns1'] = $namespace;
7399  $nsPrefix = 'ns' . rand(1000, 9999);
7400  // serialize
7401  $payload = '';
7402  if (is_string($params)) {
7403  $this->debug("serializing param string for operation $operation");
7404  $payload = $params;
7405  } elseif (is_array($params)) {
7406  $this->debug("serializing param array for operation $operation");
7407  foreach ($params as $k => $v) {
7408  $payload .= $this->serialize_val($v, $k, false, false, false, false, $use);
7409  }
7410  } else {
7411  $this->debug('params must be array or string');
7412  $this->setError('params must be array or string');
7413  return false;
7414  }
7415  $usedNamespaces = array();
7416  if ($use == 'encoded') {
7417  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
7418  } else {
7419  $encodingStyle = '';
7420  }
7421  }
7422  // wrap RPC calls with method element
7423  if ($style == 'rpc') {
7424  if ($use == 'literal') {
7425  $this->debug("wrapping RPC request with literal method element");
7426  if ($namespace) {
7427  // http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html R2735 says rpc/literal accessor elements should not be in a namespace
7428  $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" .
7429  $payload .
7430  "</$nsPrefix:$operation>";
7431  } else {
7432  $payload = "<$operation>" . $payload . "</$operation>";
7433  }
7434  } else {
7435  $this->debug("wrapping RPC request with encoded method element");
7436  if ($namespace) {
7437  $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" .
7438  $payload .
7439  "</$nsPrefix:$operation>";
7440  } else {
7441  $payload = "<$operation>" .
7442  $payload .
7443  "</$operation>";
7444  }
7445  }
7446  }
7447  // serialize envelope
7448  $soapmsg = $this->serializeEnvelope($payload, $this->requestHeaders, $usedNamespaces, $style, $use, $encodingStyle);
7449  $this->debug("endpoint=$this->endpoint, soapAction=$soapAction, namespace=$namespace, style=$style, use=$use, encodingStyle=$encodingStyle");
7450  $this->debug('SOAP message length=' . strlen($soapmsg) . ' contents (max 1000 bytes)=' . substr($soapmsg, 0, 1000));
7451  // send
7452  $return = $this->send($this->getHTTPBody($soapmsg), $soapAction, $this->timeout, $this->response_timeout);
7453  if ($errstr = $this->getError()) {
7454  $this->debug('Error: ' . $errstr);
7455  return false;
7456  } else {
7457  $this->return = $return;
7458  $this->debug('sent message successfully and got a(n) ' . gettype($return));
7459  $this->appendDebug('return=' . $this->varDump($return));
7460 
7461  // fault?
7462  if (is_array($return) && isset($return['faultcode'])) {
7463  $this->debug('got fault');
7464  $this->setError($return['faultcode'] . ': ' . $return['faultstring']);
7465  $this->fault = true;
7466  foreach ($return as $k => $v) {
7467  $this->$k = $v;
7468  $this->debug("$k = $v<br>");
7469  }
7470  return $return;
7471  } elseif ($style == 'document') {
7472  // NOTE: if the response is defined to have multiple parts (i.e. unwrapped),
7473  // we are only going to return the first part here...sorry about that
7474  return $return;
7475  } else {
7476  // array of return values
7477  if (is_array($return)) {
7478  // multiple 'out' parameters, which we return wrapped up
7479  // in the array
7480  if (sizeof($return) > 1) {
7481  return $return;
7482  }
7483  // single 'out' parameter (normally the return value)
7484  $return = array_shift($return);
7485  $this->debug('return shifted value: ');
7486  $this->appendDebug($this->varDump($return));
7487  return $return;
7488  // nothing returned (ie, echoVoid)
7489  } else {
7490  return "";
7491  }
7492  }
7493  }
7494  }
if($err=$client->getError()) $namespace
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
setError($str)
sets error string
Definition: nusoap.php:353
& getDebug()
gets the current debug data for this instance
Definition: nusoap.php:290
parses a WSDL file, allows access to it&#39;s data, other utility methods.
Definition: nusoap.php:4587
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
if(count($parts) !=3) $payload
Definition: ltitoken.php:67
send($msg, $soapaction='', $timeout=0, $response_timeout=30)
send the SOAP message
Definition: nusoap.php:7572
getError()
returns error string if present
Definition: nusoap.php:339
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
serializeRPCParameters($operation, $direction, $parameters, $bindingType='soap')
serialize PHP values according to a WSDL message definition contrary to the method name...
Definition: nusoap.php:5710
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:830
serializeEnvelope($body, $headers=false, $namespaces=array(), $style='rpc', $use='encoded', $encodingStyle='http://schemas.xmlsoap.org/soap/encoding/')
serializes a message
Definition: nusoap.php:658
getOperationData($operation)
get available data pertaining to an operation
Definition: nusoap.php:7544
getHTTPBody($soapmsg)
gets the HTTP body for the current request.
Definition: nusoap.php:7991
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:867
loadWSDL()
instantiate wsdl object and parse wsdl file
Definition: nusoap.php:7528
clearDebug()
clears the current debug data for this instance
Definition: nusoap.php:277
serialize_val($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded', $soapval=false)
serializes PHP values in accordance w/ section 5.
Definition: nusoap.php:391
+ Here is the call graph for this function:

◆ checkCookies()

nusoap_client::checkCookies ( )

checks all Cookies and delete those which are expired

Returns
boolean always return true private

Definition at line 8069 of file nusoap.php.

References nusoap_base\debug().

8070  {
8071  if (sizeof($this->cookies) == 0) {
8072  return true;
8073  }
8074  $this->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies');
8075  $curr_cookies = $this->cookies;
8076  $this->cookies = array();
8077  foreach ($curr_cookies as $cookie) {
8078  if (! is_array($cookie)) {
8079  $this->debug('Remove cookie that is not an array');
8080  continue;
8081  }
8082  if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
8083  if (strtotime($cookie['expires']) > time()) {
8084  $this->cookies[] = $cookie;
8085  } else {
8086  $this->debug('Remove expired cookie ' . $cookie['name']);
8087  }
8088  } else {
8089  $this->cookies[] = $cookie;
8090  }
8091  }
8092  $this->debug('checkCookie: ' . sizeof($this->cookies) . ' cookies left in array');
8093  return true;
8094  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
+ Here is the call graph for this function:

◆ checkWSDL()

nusoap_client::checkWSDL ( )

check WSDL passed as an instance or pulled from an endpoint

private

Definition at line 7501 of file nusoap.php.

References nusoap_base\appendDebug(), nusoap_base\clearDebug(), nusoap_base\debug(), nusoap_base\getDebug(), nusoap_base\getError(), wsdl\getOperations(), and nusoap_base\setError().

7502  {
7503  $this->appendDebug($this->wsdl->getDebug());
7504  $this->wsdl->clearDebug();
7505  $this->debug('checkWSDL');
7506  // catch errors
7507  if ($errstr = $this->wsdl->getError()) {
7508  $this->debug('got wsdl error: ' . $errstr);
7509  $this->setError('wsdl error: ' . $errstr);
7510  } elseif ($this->operations = $this->wsdl->getOperations('soap')) {
7511  $this->bindingType = 'soap';
7512  $this->debug('got ' . count($this->operations) . ' operations from wsdl ' . $this->wsdlFile . ' for binding type ' . $this->bindingType);
7513  } elseif ($this->operations = $this->wsdl->getOperations('soap12')) {
7514  $this->bindingType = 'soap12';
7515  $this->debug('got ' . count($this->operations) . ' operations from wsdl ' . $this->wsdlFile . ' for binding type ' . $this->bindingType);
7516  $this->debug('**************** WARNING: SOAP 1.2 BINDING *****************');
7517  } else {
7518  $this->debug('getOperations returned false');
7519  $this->setError('no operations defined in the WSDL document!');
7520  }
7521  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
setError($str)
sets error string
Definition: nusoap.php:353
& getDebug()
gets the current debug data for this instance
Definition: nusoap.php:290
parses a WSDL file, allows access to it&#39;s data, other utility methods.
Definition: nusoap.php:4587
getError()
returns error string if present
Definition: nusoap.php:339
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
getOperations($bindingType='soap')
returns an assoc array of operation names => operation data
Definition: nusoap.php:5166
clearDebug()
clears the current debug data for this instance
Definition: nusoap.php:277
+ Here is the call graph for this function:

◆ decodeUTF8()

nusoap_client::decodeUTF8 (   $bool)

Definition at line 8029 of file nusoap.php.

8030  {
8031  $this->decode_utf8 = $bool;
8032  return true;
8033  }

◆ getCookies()

nusoap_client::getCookies ( )

gets all Cookies

Returns
array with all internal cookies public

Definition at line 8058 of file nusoap.php.

8059  {
8060  return $this->cookies;
8061  }

◆ getDefaultRpcParams()

nusoap_client::getDefaultRpcParams ( )

gets the default RPC parameter setting.

If true, default is that call params are like RPC even for document style. Each call() can override this value.

This is no longer used.

Returns
boolean public
Deprecated:

Definition at line 7841 of file nusoap.php.

7842  {
7843  return $this->defaultRpcParams;
7844  }

◆ getHeader()

nusoap_client::getHeader ( )

get the SOAP response Header (parsed)

Returns
mixed public

Definition at line 7754 of file nusoap.php.

7755  {
7756  return $this->responseHeader;
7757  }

◆ getHeaders()

nusoap_client::getHeaders ( )

get the SOAP response headers (namespace resolution incomplete)

Returns
string public

Definition at line 7743 of file nusoap.php.

7744  {
7745  return $this->responseHeaders;
7746  }

◆ getHTTPBody()

nusoap_client::getHTTPBody (   $soapmsg)

gets the HTTP body for the current request.

Parameters
string$soapmsgThe SOAP payload
Returns
string The HTTP body, which includes the SOAP payload private

Definition at line 7991 of file nusoap.php.

7992  {
7993  return $soapmsg;
7994  }

◆ getHTTPContentType()

nusoap_client::getHTTPContentType ( )

gets the HTTP content type for the current request.

Note: getHTTPBody must be called before this.

Returns
string the HTTP content type for the current request. private

Definition at line 8004 of file nusoap.php.

8005  {
8006  return 'text/xml';
8007  }

◆ getHTTPContentTypeCharset()

nusoap_client::getHTTPContentTypeCharset ( )

gets the HTTP content type charset for the current request.

returns false for non-text content types.

Note: getHTTPBody must be called before this.

Returns
string the HTTP content type charset for the current request. private

Definition at line 8018 of file nusoap.php.

References nusoap_base\$soap_defencoding.

8019  {
8020  return $this->soap_defencoding;
8021  }
$soap_defencoding
Definition: nusoap.php:122

◆ getOperationData()

nusoap_client::getOperationData (   $operation)

get available data pertaining to an operation

Parameters
string$operationoperation name
Returns
array array of data pertaining to the operation public

Definition at line 7544 of file nusoap.php.

References nusoap_base\debug(), and nusoap_base\getError().

7545  {
7546  if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
7547  $this->loadWSDL();
7548  if ($this->getError()) {
7549  return false;
7550  }
7551  }
7552  if (isset($this->operations[$operation])) {
7553  return $this->operations[$operation];
7554  }
7555  $this->debug("No data for operation: $operation");
7556  }
parses a WSDL file, allows access to it&#39;s data, other utility methods.
Definition: nusoap.php:4587
getError()
returns error string if present
Definition: nusoap.php:339
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
loadWSDL()
instantiate wsdl object and parse wsdl file
Definition: nusoap.php:7528
+ Here is the call graph for this function:

◆ getProxy()

nusoap_client::getProxy ( )

dynamically creates an instance of a proxy class, allowing user to directly call methods from wsdl

Returns
object soap_proxy object public

Definition at line 7869 of file nusoap.php.

References $r, nusoap_base\$soap_defencoding, nusoap_base\debug(), nusoap_base\getError(), and null.

7870  {
7871  $r = rand();
7872  $evalStr = $this->_getProxyClassCode($r);
7873  //$this->debug("proxy class: $evalStr");
7874  if ($this->getError()) {
7875  $this->debug("Error from _getProxyClassCode, so return NULL");
7876  return null;
7877  }
7878  // eval the class
7879  eval($evalStr);
7880  // instantiate proxy object
7881  eval("\$proxy = new nusoap_proxy_$r('');");
7882  // transfer current wsdl data to the proxy thereby avoiding parsing the wsdl twice
7883  $proxy->endpointType = 'wsdl';
7884  $proxy->wsdlFile = $this->wsdlFile;
7885  $proxy->wsdl = $this->wsdl;
7886  $proxy->operations = $this->operations;
7887  $proxy->defaultRpcParams = $this->defaultRpcParams;
7888  // transfer other state
7889  $proxy->soap_defencoding = $this->soap_defencoding;
7890  $proxy->username = $this->username;
7891  $proxy->password = $this->password;
7892  $proxy->authtype = $this->authtype;
7893  $proxy->certRequest = $this->certRequest;
7894  $proxy->requestHeaders = $this->requestHeaders;
7895  $proxy->endpoint = $this->endpoint;
7896  $proxy->forceEndpoint = $this->forceEndpoint;
7897  $proxy->proxyhost = $this->proxyhost;
7898  $proxy->proxyport = $this->proxyport;
7899  $proxy->proxyusername = $this->proxyusername;
7900  $proxy->proxypassword = $this->proxypassword;
7901  $proxy->http_encoding = $this->http_encoding;
7902  $proxy->timeout = $this->timeout;
7903  $proxy->response_timeout = $this->response_timeout;
7904  $proxy->persistentConnection = &$this->persistentConnection;
7905  $proxy->decode_utf8 = $this->decode_utf8;
7906  $proxy->curl_options = $this->curl_options;
7907  $proxy->bindingType = $this->bindingType;
7908  $proxy->use_curl = $this->use_curl;
7909  return $proxy;
7910  }
getError()
returns error string if present
Definition: nusoap.php:339
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
_getProxyClassCode($r)
dynamically creates proxy class code
Definition: nusoap.php:7918
$soap_defencoding
Definition: nusoap.php:122
$r
+ Here is the call graph for this function:

◆ getProxyClassCode()

nusoap_client::getProxyClassCode ( )

dynamically creates proxy class code

Returns
string PHP/NuSOAP code for the proxy class public

Definition at line 7978 of file nusoap.php.

References $r.

7979  {
7980  $r = rand();
7981  return $this->_getProxyClassCode($r);
7982  }
_getProxyClassCode($r)
dynamically creates proxy class code
Definition: nusoap.php:7918
$r

◆ loadWSDL()

nusoap_client::loadWSDL ( )

instantiate wsdl object and parse wsdl file

public

Definition at line 7528 of file nusoap.php.

References nusoap_base\debug(), wsdl\fetchWSDL(), and wsdl\setCredentials().

7529  {
7530  $this->debug('instantiating wsdl class with doc: ' . $this->wsdlFile);
7531  $this->wsdl = new wsdl('', $this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword, $this->timeout, $this->response_timeout, $this->curl_options, $this->use_curl);
7532  $this->wsdl->setCredentials($this->username, $this->password, $this->authtype, $this->certRequest);
7533  $this->wsdl->fetchWSDL($this->wsdlFile);
7534  $this->checkWSDL();
7535  }
parses a WSDL file, allows access to it&#39;s data, other utility methods.
Definition: nusoap.php:4587
checkWSDL()
check WSDL passed as an instance or pulled from an endpoint
Definition: nusoap.php:7501
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
setCredentials($username, $password, $authtype='basic', $certRequest=array())
if authenticating, set user credentials here
Definition: nusoap.php:5142
fetchWSDL($wsdl)
fetches the WSDL document and parses it
Definition: nusoap.php:4670
+ Here is the call graph for this function:

◆ parseResponse()

nusoap_client::parseResponse (   $headers,
  $data 
)

processes SOAP message returned from server

Parameters
array$headersThe HTTP headers
string$dataunprocessed response data from server
Returns
mixed value of the message, decoded into a PHP type private

Definition at line 7652 of file nusoap.php.

References $data, nusoap_base\appendDebug(), nusoap_base\debug(), nusoap_base\setError(), and nusoap_base\varDump().

7653  {
7654  $this->debug('Entering parseResponse() for data of length ' . strlen($data) . ' headers:');
7655  $this->appendDebug($this->varDump($headers));
7656  if (!strstr($headers['content-type'], 'text/xml')) {
7657  $this->setError('Response not of type text/xml: ' . $headers['content-type']);
7658  return false;
7659  }
7660  if (strpos($headers['content-type'], '=')) {
7661  $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
7662  $this->debug('Got response encoding: ' . $enc);
7663  if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
7664  $this->xml_encoding = strtoupper($enc);
7665  } else {
7666  $this->xml_encoding = 'US-ASCII';
7667  }
7668  } else {
7669  // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
7670  $this->xml_encoding = 'ISO-8859-1';
7671  }
7672  $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser');
7673  $parser = new nusoap_parser($data, $this->xml_encoding, $this->operation, $this->decode_utf8);
7674  // add parser debug data to our debug
7675  $this->appendDebug($parser->getDebug());
7676  // if parse errors
7677  if ($errstr = $parser->getError()) {
7678  $this->setError($errstr);
7679  // destroy the parser object
7680  unset($parser);
7681  return false;
7682  } else {
7683  // get SOAP headers
7684  $this->responseHeaders = $parser->getHeaders();
7685  // get SOAP headers
7686  $this->responseHeader = $parser->get_soapheader();
7687  // get decoded message
7688  $return = $parser->get_soapbody();
7689  // add document for doclit support
7690  $this->document = $parser->document;
7691  // destroy the parser object
7692  unset($parser);
7693  // return decode message
7694  return $return;
7695  }
7696  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
setError($str)
sets error string
Definition: nusoap.php:353
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:867
nusoap_parser class parses SOAP XML messages into native PHP values
Definition: nusoap.php:6521
+ Here is the call graph for this function:

◆ send()

nusoap_client::send (   $msg,
  $soapaction = '',
  $timeout = 0,
  $response_timeout = 30 
)

send the SOAP message

Note: if the operation has multiple return values the return value of this method will be an array of those values.

Parameters
string$msga SOAPx4 soapmsg object
string$soapactionSOAPAction value
integer$timeoutset connection timeout in seconds
integer$response_timeoutset response timeout in seconds
Returns
mixed native PHP types. private

Definition at line 7572 of file nusoap.php.

References $http, nusoap_base\appendDebug(), nusoap_base\debug(), nusoap_base\getError(), and nusoap_base\setError().

7573  {
7574  $this->checkCookies();
7575  // detect transport
7576  switch (true) {
7577  // http(s)
7578  case preg_match('/^http/', $this->endpoint):
7579  $this->debug('transporting via HTTP');
7580  if ($this->persistentConnection == true && is_object($this->persistentConnection)) {
7582  } else {
7583  $http = new soap_transport_http($this->endpoint, $this->curl_options, $this->use_curl);
7584  if ($this->persistentConnection) {
7585  $http->usePersistentConnection();
7586  }
7587  }
7588  $http->setContentType($this->getHTTPContentType(), $this->getHTTPContentTypeCharset());
7589  $http->setSOAPAction($soapaction);
7590  if ($this->proxyhost && $this->proxyport) {
7591  $http->setProxy($this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword);
7592  }
7593  if ($this->authtype != '') {
7594  $http->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
7595  }
7596  if ($this->http_encoding != '') {
7597  $http->setEncoding($this->http_encoding);
7598  }
7599  $this->debug('sending message, length=' . strlen($msg));
7600  if (preg_match('/^http:/', $this->endpoint)) {
7601  //if(strpos($this->endpoint,'http:')){
7602  $this->responseData = $http->send($msg, $timeout, $response_timeout, $this->cookies);
7603  } elseif (preg_match('/^https/', $this->endpoint)) {
7604  //} elseif(strpos($this->endpoint,'https:')){
7605  //if(phpversion() == '4.3.0-dev'){
7606  //$response = $http->send($msg,$timeout,$response_timeout);
7607  //$this->request = $http->outgoing_payload;
7608  //$this->response = $http->incoming_payload;
7609  //} else
7610  $this->responseData = $http->sendHTTPS($msg, $timeout, $response_timeout, $this->cookies);
7611  } else {
7612  $this->setError('no http/s in endpoint url');
7613  }
7614  $this->request = $http->outgoing_payload;
7615  $this->response = $http->incoming_payload;
7616  $this->appendDebug($http->getDebug());
7617  $this->UpdateCookies($http->incoming_cookies);
7618 
7619  // save transport object if using persistent connections
7620  if ($this->persistentConnection) {
7621  $http->clearDebug();
7622  if (!is_object($this->persistentConnection)) {
7623  $this->persistentConnection = $http;
7624  }
7625  }
7626 
7627  if ($err = $http->getError()) {
7628  $this->setError('HTTP Error: ' . $err);
7629  return false;
7630  } elseif ($this->getError()) {
7631  return false;
7632  } else {
7633  $this->debug('got response, length=' . strlen($this->responseData) . ' type=' . $http->incoming_headers['content-type']);
7634  return $this->parseResponse($http->incoming_headers, $this->responseData);
7635  }
7636  break;
7637  default:
7638  $this->setError('no transport found, or selected transport is not yet supported!');
7639  return false;
7640  break;
7641  }
7642  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
setError($str)
sets error string
Definition: nusoap.php:353
transport class for sending/receiving data via HTTP and HTTPS NOTE: PHP must be compiled with the CUR...
Definition: nusoap.php:2140
parseResponse($headers, $data)
processes SOAP message returned from server
Definition: nusoap.php:7652
$http
Definition: deliver.php:30
getHTTPContentTypeCharset()
gets the HTTP content type charset for the current request.
Definition: nusoap.php:8018
getError()
returns error string if present
Definition: nusoap.php:339
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
checkCookies()
checks all Cookies and delete those which are expired
Definition: nusoap.php:8069
getHTTPContentType()
gets the HTTP content type for the current request.
Definition: nusoap.php:8004
UpdateCookies($cookies)
updates the current cookies with a new set
Definition: nusoap.php:8103
+ Here is the call graph for this function:

◆ setCookie()

nusoap_client::setCookie (   $name,
  $value 
)

adds a new Cookie into $this->cookies array

Parameters
string$nameCookie Name
string$valueCookie Value
Returns
boolean if cookie-set was successful returns true, else false public

Definition at line 8043 of file nusoap.php.

8044  {
8045  if (strlen($name) == 0) {
8046  return false;
8047  }
8048  $this->cookies[] = array('name' => $name, 'value' => $value);
8049  return true;
8050  }

◆ setCredentials()

nusoap_client::setCredentials (   $username,
  $password,
  $authtype = 'basic',
  $certRequest = array() 
)

if authenticating, set user credentials here

Parameters
string$username
string$password
string$authtype(basic|digest|certificate|ntlm)
array$certRequest(keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) public

Definition at line 7785 of file nusoap.php.

References nusoap_base\appendDebug(), nusoap_base\debug(), and nusoap_base\varDump().

7786  {
7787  $this->debug("setCredentials username=$username authtype=$authtype certRequest=");
7788  $this->appendDebug($this->varDump($certRequest));
7789  $this->username = $username;
7790  $this->password = $password;
7791  $this->authtype = $authtype;
7792  $this->certRequest = $certRequest;
7793  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:867
+ Here is the call graph for this function:

◆ setCurlOption()

nusoap_client::setCurlOption (   $option,
  $value 
)

sets user-specified cURL options

Parameters
mixed$optionThe cURL option (always integer?)
mixed$valueThe cURL option value public

Definition at line 7705 of file nusoap.php.

References nusoap_base\appendDebug(), nusoap_base\debug(), and nusoap_base\varDump().

7706  {
7707  $this->debug("setCurlOption option=$option, value=");
7708  $this->appendDebug($this->varDump($value));
7709  $this->curl_options[$option] = $value;
7710  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:867
+ Here is the call graph for this function:

◆ setDefaultRpcParams()

nusoap_client::setDefaultRpcParams (   $rpcParams)

sets the default RPC parameter setting.

If true, default is that call params are like RPC even for document style Each call() can override this value.

This is no longer used.

Parameters
boolean$rpcParamspublic
Deprecated:

Definition at line 7857 of file nusoap.php.

7858  {
7859  $this->defaultRpcParams = $rpcParams;
7860  }

◆ setEndpoint()

nusoap_client::setEndpoint (   $endpoint)

sets the SOAP endpoint, which can override WSDL

Parameters
string$endpointThe endpoint URL to use, or empty string or false to prevent override public

Definition at line 7718 of file nusoap.php.

References nusoap_base\debug().

7719  {
7720  $this->debug("setEndpoint(\"$endpoint\")");
7721  $this->forceEndpoint = $endpoint;
7722  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
+ Here is the call graph for this function:

◆ setHeaders()

nusoap_client::setHeaders (   $headers)

set the SOAP headers

Parameters
mixed$headersString of XML with SOAP header content, or array of soapval objects for SOAP headers public

Definition at line 7730 of file nusoap.php.

References nusoap_base\appendDebug(), nusoap_base\debug(), and nusoap_base\varDump().

7731  {
7732  $this->debug("setHeaders headers=");
7733  $this->appendDebug($this->varDump($headers));
7734  $this->requestHeaders = $headers;
7735  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:867
+ Here is the call graph for this function:

◆ setHTTPEncoding()

nusoap_client::setHTTPEncoding (   $enc = 'gzip,
deflate'   
)

use HTTP encoding

Parameters
string$encHTTP encoding public

Definition at line 7801 of file nusoap.php.

References nusoap_base\debug().

7802  {
7803  $this->debug("setHTTPEncoding(\"$enc\")");
7804  $this->http_encoding = $enc;
7805  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
+ Here is the call graph for this function:

◆ setHTTPProxy()

nusoap_client::setHTTPProxy (   $proxyhost,
  $proxyport,
  $proxyusername = '',
  $proxypassword = '' 
)

set proxy info here

Parameters
string$proxyhost
string$proxyport
string$proxyusername
string$proxypasswordpublic

Definition at line 7768 of file nusoap.php.

7769  {
7770  $this->proxyhost = $proxyhost;
7771  $this->proxyport = $proxyport;
7772  $this->proxyusername = $proxyusername;
7773  $this->proxypassword = $proxypassword;
7774  }

◆ setUseCURL()

nusoap_client::setUseCURL (   $use)

Set whether to try to use cURL connections if possible.

Parameters
boolean$useWhether to try to use cURL public

Definition at line 7813 of file nusoap.php.

References nusoap_base\debug().

7814  {
7815  $this->debug("setUseCURL($use)");
7816  $this->use_curl = $use;
7817  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
+ Here is the call graph for this function:

◆ UpdateCookies()

nusoap_client::UpdateCookies (   $cookies)

updates the current cookies with a new set

Parameters
array$cookiesnew cookies with which to update current ones
Returns
boolean always return true private

Definition at line 8103 of file nusoap.php.

References $path, and nusoap_base\debug().

8104  {
8105  if (sizeof($this->cookies) == 0) {
8106  // no existing cookies: take whatever is new
8107  if (sizeof($cookies) > 0) {
8108  $this->debug('Setting new cookie(s)');
8109  $this->cookies = $cookies;
8110  }
8111  return true;
8112  }
8113  if (sizeof($cookies) == 0) {
8114  // no new cookies: keep what we've got
8115  return true;
8116  }
8117  // merge
8118  foreach ($cookies as $newCookie) {
8119  if (!is_array($newCookie)) {
8120  continue;
8121  }
8122  if ((!isset($newCookie['name'])) || (!isset($newCookie['value']))) {
8123  continue;
8124  }
8125  $newName = $newCookie['name'];
8126 
8127  $found = false;
8128  for ($i = 0; $i < count($this->cookies); $i++) {
8129  $cookie = $this->cookies[$i];
8130  if (!is_array($cookie)) {
8131  continue;
8132  }
8133  if (!isset($cookie['name'])) {
8134  continue;
8135  }
8136  if ($newName != $cookie['name']) {
8137  continue;
8138  }
8139  $newDomain = isset($newCookie['domain']) ? $newCookie['domain'] : 'NODOMAIN';
8140  $domain = isset($cookie['domain']) ? $cookie['domain'] : 'NODOMAIN';
8141  if ($newDomain != $domain) {
8142  continue;
8143  }
8144  $newPath = isset($newCookie['path']) ? $newCookie['path'] : 'NOPATH';
8145  $path = isset($cookie['path']) ? $cookie['path'] : 'NOPATH';
8146  if ($newPath != $path) {
8147  continue;
8148  }
8149  $this->cookies[$i] = $newCookie;
8150  $found = true;
8151  $this->debug('Update cookie ' . $newName . '=' . $newCookie['value']);
8152  break;
8153  }
8154  if (! $found) {
8155  $this->debug('Add cookie ' . $newName . '=' . $newCookie['value']);
8156  $this->cookies[] = $newCookie;
8157  }
8158  }
8159  return true;
8160  }
$path
Definition: ltiservices.php:29
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
+ Here is the call graph for this function:

◆ useHTTPPersistentConnection()

nusoap_client::useHTTPPersistentConnection ( )

use HTTP persistent connections if possible

public

Definition at line 7824 of file nusoap.php.

References nusoap_base\debug().

7825  {
7826  $this->debug("useHTTPPersistentConnection");
7827  $this->persistentConnection = true;
7828  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
+ Here is the call graph for this function:

Field Documentation

◆ $authtype

nusoap_client::$authtype = ''

Definition at line 7191 of file nusoap.php.

◆ $bindingType

nusoap_client::$bindingType = ''

Definition at line 7217 of file nusoap.php.

◆ $certRequest

nusoap_client::$certRequest = array()

Definition at line 7192 of file nusoap.php.

◆ $cookies

nusoap_client::$cookies = array()

Definition at line 7213 of file nusoap.php.

◆ $curl_options

nusoap_client::$curl_options = array()

Definition at line 7216 of file nusoap.php.

◆ $decode_utf8

nusoap_client::$decode_utf8 = true

Definition at line 7214 of file nusoap.php.

◆ $defaultRpcParams

nusoap_client::$defaultRpcParams = false

Definition at line 7209 of file nusoap.php.

◆ $document

nusoap_client::$document = ''

Definition at line 7196 of file nusoap.php.

◆ $endpoint

nusoap_client::$endpoint

Definition at line 7197 of file nusoap.php.

◆ $endpointType

nusoap_client::$endpointType = ''

Definition at line 7207 of file nusoap.php.

◆ $fault

nusoap_client::$fault

Definition at line 7227 of file nusoap.php.

◆ $faultcode

nusoap_client::$faultcode

Definition at line 7232 of file nusoap.php.

◆ $faultdetail

nusoap_client::$faultdetail

Definition at line 7242 of file nusoap.php.

◆ $faultstring

nusoap_client::$faultstring

Definition at line 7237 of file nusoap.php.

◆ $forceEndpoint

nusoap_client::$forceEndpoint = ''

Definition at line 7198 of file nusoap.php.

◆ $http_encoding

nusoap_client::$http_encoding = false

Definition at line 7204 of file nusoap.php.

◆ $opData

nusoap_client::$opData

Definition at line 7187 of file nusoap.php.

◆ $operation

nusoap_client::$operation

Definition at line 7188 of file nusoap.php.

◆ $operations

nusoap_client::$operations = array()

Definition at line 7215 of file nusoap.php.

◆ $password

nusoap_client::$password = ''

Definition at line 7190 of file nusoap.php.

◆ $persistentConnection

nusoap_client::$persistentConnection = false

Definition at line 7208 of file nusoap.php.

◆ $proxyhost

nusoap_client::$proxyhost = ''

Definition at line 7199 of file nusoap.php.

◆ $proxypassword

nusoap_client::$proxypassword = ''

Definition at line 7202 of file nusoap.php.

◆ $proxyport

nusoap_client::$proxyport = ''

Definition at line 7200 of file nusoap.php.

◆ $proxyusername

nusoap_client::$proxyusername = ''

Definition at line 7201 of file nusoap.php.

◆ $request

nusoap_client::$request = ''

Definition at line 7210 of file nusoap.php.

◆ $requestHeaders

nusoap_client::$requestHeaders = false

Definition at line 7193 of file nusoap.php.

◆ $response

nusoap_client::$response = ''

Definition at line 7211 of file nusoap.php.

◆ $response_timeout

nusoap_client::$response_timeout = 30

Definition at line 7206 of file nusoap.php.

◆ $responseData

nusoap_client::$responseData = ''

Definition at line 7212 of file nusoap.php.

◆ $responseHeader

nusoap_client::$responseHeader = null

Definition at line 7195 of file nusoap.php.

◆ $responseHeaders

nusoap_client::$responseHeaders = ''

Definition at line 7194 of file nusoap.php.

◆ $return

nusoap_client::$return

Definition at line 7184 of file nusoap.php.

◆ $timeout

nusoap_client::$timeout = 0

Definition at line 7205 of file nusoap.php.

◆ $use_curl

nusoap_client::$use_curl = false

Definition at line 7218 of file nusoap.php.

◆ $username

nusoap_client::$username = ''

Definition at line 7189 of file nusoap.php.

◆ $wsdl

nusoap_client::$wsdl

Definition at line 7185 of file nusoap.php.

◆ $wsdlFile

nusoap_client::$wsdlFile

Definition at line 7186 of file nusoap.php.

◆ $xml_encoding

nusoap_client::$xml_encoding = ''

Definition at line 7203 of file nusoap.php.


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