ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 7227 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 7303 of file nusoap.php.

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

7304  {
7306  $this->endpoint = $endpoint;
7307  $this->proxyhost = $proxyhost;
7308  $this->proxyport = $proxyport;
7309  $this->proxyusername = $proxyusername;
7310  $this->proxypassword = $proxypassword;
7311  $this->timeout = $timeout;
7312  $this->response_timeout = $response_timeout;
7313 
7314  $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
7315  $this->appendDebug('endpoint=' . $this->varDump($endpoint));
7316 
7317  // make values
7318  if ($wsdl) {
7319  if (is_object($endpoint) && (get_class($endpoint) == 'wsdl')) {
7320  $this->wsdl = $endpoint;
7321  $this->endpoint = $this->wsdl->wsdl;
7322  $this->wsdlFile = $this->endpoint;
7323  $this->debug('existing wsdl instance created from ' . $this->endpoint);
7324  $this->checkWSDL();
7325  } else {
7326  $this->wsdlFile = $this->endpoint;
7327  $this->wsdl = null;
7328  $this->debug('will use lazy evaluation of wsdl from ' . $this->endpoint);
7329  }
7330  $this->endpointType = 'wsdl';
7331  } else {
7332  $this->debug("instantiate SOAP with endpoint at $endpoint");
7333  $this->endpointType = 'soap';
7334  }
7335  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:303
parses a WSDL file, allows access to it's data, other utility methods.
Definition: nusoap.php:4630
checkWSDL()
check WSDL passed as an instance or pulled from an endpoint
Definition: nusoap.php:7546
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:907
__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 7963 of file nusoap.php.

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

7964  {
7965  $this->debug("in getProxy endpointType=$this->endpointType");
7966  $this->appendDebug("wsdl=" . $this->varDump($this->wsdl));
7967  if ($this->endpointType != 'wsdl') {
7968  $evalStr = 'A proxy can only be created for a WSDL client';
7969  $this->setError($evalStr);
7970  $evalStr = "echo \"$evalStr\";";
7971  return $evalStr;
7972  }
7973  if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
7974  $this->loadWSDL();
7975  if ($this->getError()) {
7976  return "echo \"" . $this->getError() . "\";";
7977  }
7978  }
7979  $evalStr = '';
7980  foreach ($this->operations as $operation => $opData) {
7981  if ($operation != '') {
7982  // create param string and param comment string
7983  if (sizeof($opData['input']['parts']) > 0) {
7984  $paramStr = '';
7985  $paramArrayStr = '';
7986  $paramCommentStr = '';
7987  foreach ($opData['input']['parts'] as $name => $type) {
7988  $paramStr .= "\$$name, ";
7989  $paramArrayStr .= "'$name' => \$$name, ";
7990  $paramCommentStr .= "$type \$$name, ";
7991  }
7992  $paramStr = substr($paramStr, 0, strlen($paramStr)-2);
7993  $paramArrayStr = substr($paramArrayStr, 0, strlen($paramArrayStr)-2);
7994  $paramCommentStr = substr($paramCommentStr, 0, strlen($paramCommentStr)-2);
7995  } else {
7996  $paramStr = '';
7997  $paramArrayStr = '';
7998  $paramCommentStr = 'void';
7999  }
8000  $opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace'];
8001  $evalStr .= "// $paramCommentStr
8002  function " . str_replace('.', '__', $operation) . "($paramStr) {
8003  \$params = array($paramArrayStr);
8004  return \$this->call('$operation', \$params, '" . $opData['namespace'] . "', '" . (isset($opData['soapAction']) ? $opData['soapAction'] : '') . "');
8005  }
8006  ";
8007  unset($paramStr);
8008  unset($paramCommentStr);
8009  }
8010  }
8011  $evalStr = 'class nusoap_proxy_' . $r . ' extends nusoap_client {
8012  ' . $evalStr . '
8013 }';
8014  return $evalStr;
8015  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:303
setError($str)
sets error string
Definition: nusoap.php:393
parses a WSDL file, allows access to it's data, other utility methods.
Definition: nusoap.php:4630
getError()
returns error string if present
Definition: nusoap.php:379
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:907
loadWSDL()
instantiate wsdl object and parse wsdl file
Definition: nusoap.php:7573
$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 7362 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().

7362  ://tempuri.org', $soapAction='', $headers=false, $rpcParams=null, $style='rpc', $use='encoded')
7363  {
7364  $this->operation = $operation;
7365  $this->fault = false;
7366  $this->setError('');
7367  $this->request = '';
7368  $this->response = '';
7369  $this->responseData = '';
7370  $this->faultstring = '';
7371  $this->faultcode = '';
7372  $this->opData = array();
7373 
7374  $this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType");
7375  $this->appendDebug('params=' . $this->varDump($params));
7376  $this->appendDebug('headers=' . $this->varDump($headers));
7377  if ($headers) {
7378  $this->requestHeaders = $headers;
7379  }
7380  if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
7381  $this->loadWSDL();
7382  if ($this->getError()) {
7383  return false;
7384  }
7385  }
7386  // serialize parameters
7387  if ($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)) {
7388  // use WSDL for operation
7389  $this->opData = $opData;
7390  $this->debug("found operation");
7391  $this->appendDebug('opData=' . $this->varDump($opData));
7392  if (isset($opData['soapAction'])) {
7393  $soapAction = $opData['soapAction'];
7394  }
7395  if (! $this->forceEndpoint) {
7396  $this->endpoint = $opData['endpoint'];
7397  } else {
7398  $this->endpoint = $this->forceEndpoint;
7399  }
7400  $namespace = isset($opData['input']['namespace']) ? $opData['input']['namespace'] : $namespace;
7401  $style = $opData['style'];
7402  $use = $opData['input']['use'];
7403  // add ns to ns array
7404  if ($namespace != '' && !isset($this->wsdl->namespaces[$namespace])) {
7405  $nsPrefix = 'ns' . rand(1000, 9999);
7406  $this->wsdl->namespaces[$nsPrefix] = $namespace;
7407  }
7408  $nsPrefix = $this->wsdl->getPrefixFromNamespace($namespace);
7409  // serialize payload
7410  if (is_string($params)) {
7411  $this->debug("serializing param string for WSDL operation $operation");
7412  $payload = $params;
7413  } elseif (is_array($params)) {
7414  $this->debug("serializing param array for WSDL operation $operation");
7415  $payload = $this->wsdl->serializeRPCParameters($operation, 'input', $params, $this->bindingType);
7416  } else {
7417  $this->debug('params must be array or string');
7418  $this->setError('params must be array or string');
7419  return false;
7420  }
7421  $usedNamespaces = $this->wsdl->usedNamespaces;
7422  if (isset($opData['input']['encodingStyle'])) {
7423  $encodingStyle = $opData['input']['encodingStyle'];
7424  } else {
7425  $encodingStyle = '';
7426  }
7427  $this->appendDebug($this->wsdl->getDebug());
7428  $this->wsdl->clearDebug();
7429  if ($errstr = $this->wsdl->getError()) {
7430  $this->debug('got wsdl error: ' . $errstr);
7431  $this->setError('wsdl error: ' . $errstr);
7432  return false;
7433  }
7434  } elseif ($this->endpointType == 'wsdl') {
7435  // operation not in WSDL
7436  $this->appendDebug($this->wsdl->getDebug());
7437  $this->wsdl->clearDebug();
7438  $this->setError('operation ' . $operation . ' not present.');
7439  $this->debug("operation '$operation' not present.");
7440  return false;
7441  } else {
7442  // no WSDL
7443  //$this->namespaces['ns1'] = $namespace;
7444  $nsPrefix = 'ns' . rand(1000, 9999);
7445  // serialize
7446  $payload = '';
7447  if (is_string($params)) {
7448  $this->debug("serializing param string for operation $operation");
7449  $payload = $params;
7450  } elseif (is_array($params)) {
7451  $this->debug("serializing param array for operation $operation");
7452  foreach ($params as $k => $v) {
7453  $payload .= $this->serialize_val($v, $k, false, false, false, false, $use);
7454  }
7455  } else {
7456  $this->debug('params must be array or string');
7457  $this->setError('params must be array or string');
7458  return false;
7459  }
7460  $usedNamespaces = array();
7461  if ($use == 'encoded') {
7462  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
7463  } else {
7464  $encodingStyle = '';
7465  }
7466  }
7467  // wrap RPC calls with method element
7468  if ($style == 'rpc') {
7469  if ($use == 'literal') {
7470  $this->debug("wrapping RPC request with literal method element");
7471  if ($namespace) {
7472  // 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
7473  $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" .
7474  $payload .
7475  "</$nsPrefix:$operation>";
7476  } else {
7477  $payload = "<$operation>" . $payload . "</$operation>";
7478  }
7479  } else {
7480  $this->debug("wrapping RPC request with encoded method element");
7481  if ($namespace) {
7482  $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" .
7483  $payload .
7484  "</$nsPrefix:$operation>";
7485  } else {
7486  $payload = "<$operation>" .
7487  $payload .
7488  "</$operation>";
7489  }
7490  }
7491  }
7492  // serialize envelope
7493  $soapmsg = $this->serializeEnvelope($payload, $this->requestHeaders, $usedNamespaces, $style, $use, $encodingStyle);
7494  $this->debug("endpoint=$this->endpoint, soapAction=$soapAction, namespace=$namespace, style=$style, use=$use, encodingStyle=$encodingStyle");
7495  $this->debug('SOAP message length=' . strlen($soapmsg) . ' contents (max 1000 bytes)=' . substr($soapmsg, 0, 1000));
7496  // send
7497  $return = $this->send($this->getHTTPBody($soapmsg), $soapAction, $this->timeout, $this->response_timeout);
7498  if ($errstr = $this->getError()) {
7499  $this->debug('Error: ' . $errstr);
7500  return false;
7501  } else {
7502  $this->return = $return;
7503  $this->debug('sent message successfully and got a(n) ' . gettype($return));
7504  $this->appendDebug('return=' . $this->varDump($return));
7505 
7506  // fault?
7507  if (is_array($return) && isset($return['faultcode'])) {
7508  $this->debug('got fault');
7509  $this->setError($return['faultcode'] . ': ' . $return['faultstring']);
7510  $this->fault = true;
7511  foreach ($return as $k => $v) {
7512  $this->$k = $v;
7513  $this->debug("$k = $v<br>");
7514  }
7515  return $return;
7516  } elseif ($style == 'document') {
7517  // NOTE: if the response is defined to have multiple parts (i.e. unwrapped),
7518  // we are only going to return the first part here...sorry about that
7519  return $return;
7520  } else {
7521  // array of return values
7522  if (is_array($return)) {
7523  // multiple 'out' parameters, which we return wrapped up
7524  // in the array
7525  if (sizeof($return) > 1) {
7526  return $return;
7527  }
7528  // single 'out' parameter (normally the return value)
7529  $return = array_shift($return);
7530  $this->debug('return shifted value: ');
7531  $this->appendDebug($this->varDump($return));
7532  return $return;
7533  // nothing returned (ie, echoVoid)
7534  } else {
7535  return "";
7536  }
7537  }
7538  }
7539  }
if($err=$client->getError()) $namespace
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:303
setError($str)
sets error string
Definition: nusoap.php:393
& getDebug()
gets the current debug data for this instance
Definition: nusoap.php:330
parses a WSDL file, allows access to it&#39;s data, other utility methods.
Definition: nusoap.php:4630
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:7617
getError()
returns error string if present
Definition: nusoap.php:379
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
serializeRPCParameters($operation, $direction, $parameters, $bindingType='soap')
serialize PHP values according to a WSDL message definition contrary to the method name...
Definition: nusoap.php:5754
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:870
serializeEnvelope($body, $headers=false, $namespaces=array(), $style='rpc', $use='encoded', $encodingStyle='http://schemas.xmlsoap.org/soap/encoding/')
serializes a message
Definition: nusoap.php:698
getOperationData($operation)
get available data pertaining to an operation
Definition: nusoap.php:7589
getHTTPBody($soapmsg)
gets the HTTP body for the current request.
Definition: nusoap.php:8036
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:907
loadWSDL()
instantiate wsdl object and parse wsdl file
Definition: nusoap.php:7573
clearDebug()
clears the current debug data for this instance
Definition: nusoap.php:317
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:431
+ 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 8114 of file nusoap.php.

References nusoap_base\debug().

8115  {
8116  if (sizeof($this->cookies) == 0) {
8117  return true;
8118  }
8119  $this->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies');
8120  $curr_cookies = $this->cookies;
8121  $this->cookies = array();
8122  foreach ($curr_cookies as $cookie) {
8123  if (! is_array($cookie)) {
8124  $this->debug('Remove cookie that is not an array');
8125  continue;
8126  }
8127  if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
8128  if (strtotime($cookie['expires']) > time()) {
8129  $this->cookies[] = $cookie;
8130  } else {
8131  $this->debug('Remove expired cookie ' . $cookie['name']);
8132  }
8133  } else {
8134  $this->cookies[] = $cookie;
8135  }
8136  }
8137  $this->debug('checkCookie: ' . sizeof($this->cookies) . ' cookies left in array');
8138  return true;
8139  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
+ 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 7546 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().

7547  {
7548  $this->appendDebug($this->wsdl->getDebug());
7549  $this->wsdl->clearDebug();
7550  $this->debug('checkWSDL');
7551  // catch errors
7552  if ($errstr = $this->wsdl->getError()) {
7553  $this->debug('got wsdl error: ' . $errstr);
7554  $this->setError('wsdl error: ' . $errstr);
7555  } elseif ($this->operations = $this->wsdl->getOperations('soap')) {
7556  $this->bindingType = 'soap';
7557  $this->debug('got ' . count($this->operations) . ' operations from wsdl ' . $this->wsdlFile . ' for binding type ' . $this->bindingType);
7558  } elseif ($this->operations = $this->wsdl->getOperations('soap12')) {
7559  $this->bindingType = 'soap12';
7560  $this->debug('got ' . count($this->operations) . ' operations from wsdl ' . $this->wsdlFile . ' for binding type ' . $this->bindingType);
7561  $this->debug('**************** WARNING: SOAP 1.2 BINDING *****************');
7562  } else {
7563  $this->debug('getOperations returned false');
7564  $this->setError('no operations defined in the WSDL document!');
7565  }
7566  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:303
setError($str)
sets error string
Definition: nusoap.php:393
& getDebug()
gets the current debug data for this instance
Definition: nusoap.php:330
parses a WSDL file, allows access to it&#39;s data, other utility methods.
Definition: nusoap.php:4630
getError()
returns error string if present
Definition: nusoap.php:379
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
getOperations($bindingType='soap')
returns an assoc array of operation names => operation data
Definition: nusoap.php:5210
clearDebug()
clears the current debug data for this instance
Definition: nusoap.php:317
+ Here is the call graph for this function:

◆ decodeUTF8()

nusoap_client::decodeUTF8 (   $bool)

Definition at line 8074 of file nusoap.php.

8075  {
8076  $this->decode_utf8 = $bool;
8077  return true;
8078  }

◆ getCookies()

nusoap_client::getCookies ( )

gets all Cookies

Returns
array with all internal cookies public

Definition at line 8103 of file nusoap.php.

8104  {
8105  return $this->cookies;
8106  }

◆ 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 7886 of file nusoap.php.

7887  {
7888  return $this->defaultRpcParams;
7889  }

◆ getHeader()

nusoap_client::getHeader ( )

get the SOAP response Header (parsed)

Returns
mixed public

Definition at line 7799 of file nusoap.php.

7800  {
7801  return $this->responseHeader;
7802  }

◆ getHeaders()

nusoap_client::getHeaders ( )

get the SOAP response headers (namespace resolution incomplete)

Returns
string public

Definition at line 7788 of file nusoap.php.

7789  {
7790  return $this->responseHeaders;
7791  }

◆ 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 8036 of file nusoap.php.

8037  {
8038  return $soapmsg;
8039  }

◆ 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 8049 of file nusoap.php.

8050  {
8051  return 'text/xml';
8052  }

◆ 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 8063 of file nusoap.php.

References nusoap_base\$soap_defencoding.

8064  {
8065  return $this->soap_defencoding;
8066  }
$soap_defencoding
Definition: nusoap.php:162

◆ 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 7589 of file nusoap.php.

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

7590  {
7591  if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
7592  $this->loadWSDL();
7593  if ($this->getError()) {
7594  return false;
7595  }
7596  }
7597  if (isset($this->operations[$operation])) {
7598  return $this->operations[$operation];
7599  }
7600  $this->debug("No data for operation: $operation");
7601  }
parses a WSDL file, allows access to it&#39;s data, other utility methods.
Definition: nusoap.php:4630
getError()
returns error string if present
Definition: nusoap.php:379
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
loadWSDL()
instantiate wsdl object and parse wsdl file
Definition: nusoap.php:7573
+ 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 7914 of file nusoap.php.

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

7915  {
7916  $r = rand();
7917  $evalStr = $this->_getProxyClassCode($r);
7918  //$this->debug("proxy class: $evalStr");
7919  if ($this->getError()) {
7920  $this->debug("Error from _getProxyClassCode, so return NULL");
7921  return null;
7922  }
7923  // eval the class
7924  eval($evalStr);
7925  // instantiate proxy object
7926  eval("\$proxy = new nusoap_proxy_$r('');");
7927  // transfer current wsdl data to the proxy thereby avoiding parsing the wsdl twice
7928  $proxy->endpointType = 'wsdl';
7929  $proxy->wsdlFile = $this->wsdlFile;
7930  $proxy->wsdl = $this->wsdl;
7931  $proxy->operations = $this->operations;
7932  $proxy->defaultRpcParams = $this->defaultRpcParams;
7933  // transfer other state
7934  $proxy->soap_defencoding = $this->soap_defencoding;
7935  $proxy->username = $this->username;
7936  $proxy->password = $this->password;
7937  $proxy->authtype = $this->authtype;
7938  $proxy->certRequest = $this->certRequest;
7939  $proxy->requestHeaders = $this->requestHeaders;
7940  $proxy->endpoint = $this->endpoint;
7941  $proxy->forceEndpoint = $this->forceEndpoint;
7942  $proxy->proxyhost = $this->proxyhost;
7943  $proxy->proxyport = $this->proxyport;
7944  $proxy->proxyusername = $this->proxyusername;
7945  $proxy->proxypassword = $this->proxypassword;
7946  $proxy->http_encoding = $this->http_encoding;
7947  $proxy->timeout = $this->timeout;
7948  $proxy->response_timeout = $this->response_timeout;
7949  $proxy->persistentConnection = &$this->persistentConnection;
7950  $proxy->decode_utf8 = $this->decode_utf8;
7951  $proxy->curl_options = $this->curl_options;
7952  $proxy->bindingType = $this->bindingType;
7953  $proxy->use_curl = $this->use_curl;
7954  return $proxy;
7955  }
getError()
returns error string if present
Definition: nusoap.php:379
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
_getProxyClassCode($r)
dynamically creates proxy class code
Definition: nusoap.php:7963
$soap_defencoding
Definition: nusoap.php:162
$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 8023 of file nusoap.php.

References $r.

8024  {
8025  $r = rand();
8026  return $this->_getProxyClassCode($r);
8027  }
_getProxyClassCode($r)
dynamically creates proxy class code
Definition: nusoap.php:7963
$r

◆ loadWSDL()

nusoap_client::loadWSDL ( )

instantiate wsdl object and parse wsdl file

public

Definition at line 7573 of file nusoap.php.

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

7574  {
7575  $this->debug('instantiating wsdl class with doc: ' . $this->wsdlFile);
7576  $this->wsdl = new wsdl('', $this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword, $this->timeout, $this->response_timeout, $this->curl_options, $this->use_curl);
7577  $this->wsdl->setCredentials($this->username, $this->password, $this->authtype, $this->certRequest);
7578  $this->wsdl->fetchWSDL($this->wsdlFile);
7579  $this->checkWSDL();
7580  }
parses a WSDL file, allows access to it&#39;s data, other utility methods.
Definition: nusoap.php:4630
checkWSDL()
check WSDL passed as an instance or pulled from an endpoint
Definition: nusoap.php:7546
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
setCredentials($username, $password, $authtype='basic', $certRequest=array())
if authenticating, set user credentials here
Definition: nusoap.php:5186
fetchWSDL($wsdl)
fetches the WSDL document and parses it
Definition: nusoap.php:4713
+ 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 7697 of file nusoap.php.

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

7698  {
7699  $this->debug('Entering parseResponse() for data of length ' . strlen($data) . ' headers:');
7700  $this->appendDebug($this->varDump($headers));
7701  if (!strstr($headers['content-type'], 'text/xml')) {
7702  $this->setError('Response not of type text/xml: ' . $headers['content-type']);
7703  return false;
7704  }
7705  if (strpos($headers['content-type'], '=')) {
7706  $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
7707  $this->debug('Got response encoding: ' . $enc);
7708  if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
7709  $this->xml_encoding = strtoupper($enc);
7710  } else {
7711  $this->xml_encoding = 'US-ASCII';
7712  }
7713  } else {
7714  // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
7715  $this->xml_encoding = 'ISO-8859-1';
7716  }
7717  $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser');
7718  $parser = new nusoap_parser($data, $this->xml_encoding, $this->operation, $this->decode_utf8);
7719  // add parser debug data to our debug
7720  $this->appendDebug($parser->getDebug());
7721  // if parse errors
7722  if ($errstr = $parser->getError()) {
7723  $this->setError($errstr);
7724  // destroy the parser object
7725  unset($parser);
7726  return false;
7727  } else {
7728  // get SOAP headers
7729  $this->responseHeaders = $parser->getHeaders();
7730  // get SOAP headers
7731  $this->responseHeader = $parser->get_soapheader();
7732  // get decoded message
7733  $return = $parser->get_soapbody();
7734  // add document for doclit support
7735  $this->document = $parser->document;
7736  // destroy the parser object
7737  unset($parser);
7738  // return decode message
7739  return $return;
7740  }
7741  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:303
setError($str)
sets error string
Definition: nusoap.php:393
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:907
nusoap_parser class parses SOAP XML messages into native PHP values
Definition: nusoap.php:6565
+ 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 7617 of file nusoap.php.

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

7618  {
7619  $this->checkCookies();
7620  // detect transport
7621  switch (true) {
7622  // http(s)
7623  case preg_match('/^http/', $this->endpoint):
7624  $this->debug('transporting via HTTP');
7625  if ($this->persistentConnection == true && is_object($this->persistentConnection)) {
7627  } else {
7628  $http = new soap_transport_http($this->endpoint, $this->curl_options, $this->use_curl);
7629  if ($this->persistentConnection) {
7630  $http->usePersistentConnection();
7631  }
7632  }
7633  $http->setContentType($this->getHTTPContentType(), $this->getHTTPContentTypeCharset());
7634  $http->setSOAPAction($soapaction);
7635  if ($this->proxyhost && $this->proxyport) {
7636  $http->setProxy($this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword);
7637  }
7638  if ($this->authtype != '') {
7639  $http->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
7640  }
7641  if ($this->http_encoding != '') {
7642  $http->setEncoding($this->http_encoding);
7643  }
7644  $this->debug('sending message, length=' . strlen($msg));
7645  if (preg_match('/^http:/', $this->endpoint)) {
7646  //if(strpos($this->endpoint,'http:')){
7647  $this->responseData = $http->send($msg, $timeout, $response_timeout, $this->cookies);
7648  } elseif (preg_match('/^https/', $this->endpoint)) {
7649  //} elseif(strpos($this->endpoint,'https:')){
7650  //if(phpversion() == '4.3.0-dev'){
7651  //$response = $http->send($msg,$timeout,$response_timeout);
7652  //$this->request = $http->outgoing_payload;
7653  //$this->response = $http->incoming_payload;
7654  //} else
7655  $this->responseData = $http->sendHTTPS($msg, $timeout, $response_timeout, $this->cookies);
7656  } else {
7657  $this->setError('no http/s in endpoint url');
7658  }
7659  $this->request = $http->outgoing_payload;
7660  $this->response = $http->incoming_payload;
7661  $this->appendDebug($http->getDebug());
7662  $this->UpdateCookies($http->incoming_cookies);
7663 
7664  // save transport object if using persistent connections
7665  if ($this->persistentConnection) {
7666  $http->clearDebug();
7667  if (!is_object($this->persistentConnection)) {
7668  $this->persistentConnection = $http;
7669  }
7670  }
7671 
7672  if ($err = $http->getError()) {
7673  $this->setError('HTTP Error: ' . $err);
7674  return false;
7675  } elseif ($this->getError()) {
7676  return false;
7677  } else {
7678  $this->debug('got response, length=' . strlen($this->responseData) . ' type=' . $http->incoming_headers['content-type']);
7679  return $this->parseResponse($http->incoming_headers, $this->responseData);
7680  }
7681  break;
7682  default:
7683  $this->setError('no transport found, or selected transport is not yet supported!');
7684  return false;
7685  break;
7686  }
7687  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:303
setError($str)
sets error string
Definition: nusoap.php:393
transport class for sending/receiving data via HTTP and HTTPS NOTE: PHP must be compiled with the CUR...
Definition: nusoap.php:2183
parseResponse($headers, $data)
processes SOAP message returned from server
Definition: nusoap.php:7697
$http
Definition: deliver.php:14
getHTTPContentTypeCharset()
gets the HTTP content type charset for the current request.
Definition: nusoap.php:8063
getError()
returns error string if present
Definition: nusoap.php:379
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
checkCookies()
checks all Cookies and delete those which are expired
Definition: nusoap.php:8114
getHTTPContentType()
gets the HTTP content type for the current request.
Definition: nusoap.php:8049
UpdateCookies($cookies)
updates the current cookies with a new set
Definition: nusoap.php:8148
+ 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 8088 of file nusoap.php.

8089  {
8090  if (strlen($name) == 0) {
8091  return false;
8092  }
8093  $this->cookies[] = array('name' => $name, 'value' => $value);
8094  return true;
8095  }

◆ 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 7830 of file nusoap.php.

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

7831  {
7832  $this->debug("setCredentials username=$username authtype=$authtype certRequest=");
7833  $this->appendDebug($this->varDump($certRequest));
7834  $this->username = $username;
7835  $this->password = $password;
7836  $this->authtype = $authtype;
7837  $this->certRequest = $certRequest;
7838  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:303
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:907
+ 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 7750 of file nusoap.php.

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

7751  {
7752  $this->debug("setCurlOption option=$option, value=");
7753  $this->appendDebug($this->varDump($value));
7754  $this->curl_options[$option] = $value;
7755  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:303
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:907
+ 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 7902 of file nusoap.php.

7903  {
7904  $this->defaultRpcParams = $rpcParams;
7905  }

◆ 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 7763 of file nusoap.php.

References nusoap_base\debug().

7764  {
7765  $this->debug("setEndpoint(\"$endpoint\")");
7766  $this->forceEndpoint = $endpoint;
7767  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
+ 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 7775 of file nusoap.php.

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

7776  {
7777  $this->debug("setHeaders headers=");
7778  $this->appendDebug($this->varDump($headers));
7779  $this->requestHeaders = $headers;
7780  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:303
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:907
+ 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 7846 of file nusoap.php.

References nusoap_base\debug().

7847  {
7848  $this->debug("setHTTPEncoding(\"$enc\")");
7849  $this->http_encoding = $enc;
7850  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
+ 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 7813 of file nusoap.php.

7814  {
7815  $this->proxyhost = $proxyhost;
7816  $this->proxyport = $proxyport;
7817  $this->proxyusername = $proxyusername;
7818  $this->proxypassword = $proxypassword;
7819  }

◆ 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 7858 of file nusoap.php.

References nusoap_base\debug().

7859  {
7860  $this->debug("setUseCURL($use)");
7861  $this->use_curl = $use;
7862  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
+ 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 8148 of file nusoap.php.

References $path, and nusoap_base\debug().

8149  {
8150  if (sizeof($this->cookies) == 0) {
8151  // no existing cookies: take whatever is new
8152  if (sizeof($cookies) > 0) {
8153  $this->debug('Setting new cookie(s)');
8154  $this->cookies = $cookies;
8155  }
8156  return true;
8157  }
8158  if (sizeof($cookies) == 0) {
8159  // no new cookies: keep what we've got
8160  return true;
8161  }
8162  // merge
8163  foreach ($cookies as $newCookie) {
8164  if (!is_array($newCookie)) {
8165  continue;
8166  }
8167  if ((!isset($newCookie['name'])) || (!isset($newCookie['value']))) {
8168  continue;
8169  }
8170  $newName = $newCookie['name'];
8171 
8172  $found = false;
8173  for ($i = 0; $i < count($this->cookies); $i++) {
8174  $cookie = $this->cookies[$i];
8175  if (!is_array($cookie)) {
8176  continue;
8177  }
8178  if (!isset($cookie['name'])) {
8179  continue;
8180  }
8181  if ($newName != $cookie['name']) {
8182  continue;
8183  }
8184  $newDomain = isset($newCookie['domain']) ? $newCookie['domain'] : 'NODOMAIN';
8185  $domain = isset($cookie['domain']) ? $cookie['domain'] : 'NODOMAIN';
8186  if ($newDomain != $domain) {
8187  continue;
8188  }
8189  $newPath = isset($newCookie['path']) ? $newCookie['path'] : 'NOPATH';
8190  $path = isset($cookie['path']) ? $cookie['path'] : 'NOPATH';
8191  if ($newPath != $path) {
8192  continue;
8193  }
8194  $this->cookies[$i] = $newCookie;
8195  $found = true;
8196  $this->debug('Update cookie ' . $newName . '=' . $newCookie['value']);
8197  break;
8198  }
8199  if (! $found) {
8200  $this->debug('Add cookie ' . $newName . '=' . $newCookie['value']);
8201  $this->cookies[] = $newCookie;
8202  }
8203  }
8204  return true;
8205  }
$path
Definition: ltiservices.php:30
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
+ Here is the call graph for this function:

◆ useHTTPPersistentConnection()

nusoap_client::useHTTPPersistentConnection ( )

use HTTP persistent connections if possible

public

Definition at line 7869 of file nusoap.php.

References nusoap_base\debug().

7870  {
7871  $this->debug("useHTTPPersistentConnection");
7872  $this->persistentConnection = true;
7873  }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:290
+ Here is the call graph for this function:

Field Documentation

◆ $authtype

nusoap_client::$authtype = ''

Definition at line 7236 of file nusoap.php.

◆ $bindingType

nusoap_client::$bindingType = ''

Definition at line 7262 of file nusoap.php.

◆ $certRequest

nusoap_client::$certRequest = array()

Definition at line 7237 of file nusoap.php.

◆ $cookies

nusoap_client::$cookies = array()

Definition at line 7258 of file nusoap.php.

◆ $curl_options

nusoap_client::$curl_options = array()

Definition at line 7261 of file nusoap.php.

◆ $decode_utf8

nusoap_client::$decode_utf8 = true

Definition at line 7259 of file nusoap.php.

◆ $defaultRpcParams

nusoap_client::$defaultRpcParams = false

Definition at line 7254 of file nusoap.php.

◆ $document

nusoap_client::$document = ''

Definition at line 7241 of file nusoap.php.

◆ $endpoint

nusoap_client::$endpoint

Definition at line 7242 of file nusoap.php.

◆ $endpointType

nusoap_client::$endpointType = ''

Definition at line 7252 of file nusoap.php.

◆ $fault

nusoap_client::$fault

Definition at line 7272 of file nusoap.php.

◆ $faultcode

nusoap_client::$faultcode

Definition at line 7277 of file nusoap.php.

◆ $faultdetail

nusoap_client::$faultdetail

Definition at line 7287 of file nusoap.php.

◆ $faultstring

nusoap_client::$faultstring

Definition at line 7282 of file nusoap.php.

◆ $forceEndpoint

nusoap_client::$forceEndpoint = ''

Definition at line 7243 of file nusoap.php.

◆ $http_encoding

nusoap_client::$http_encoding = false

Definition at line 7249 of file nusoap.php.

◆ $opData

nusoap_client::$opData

Definition at line 7232 of file nusoap.php.

◆ $operation

nusoap_client::$operation

Definition at line 7233 of file nusoap.php.

◆ $operations

nusoap_client::$operations = array()

Definition at line 7260 of file nusoap.php.

◆ $password

nusoap_client::$password = ''

Definition at line 7235 of file nusoap.php.

◆ $persistentConnection

nusoap_client::$persistentConnection = false

Definition at line 7253 of file nusoap.php.

◆ $proxyhost

nusoap_client::$proxyhost = ''

Definition at line 7244 of file nusoap.php.

◆ $proxypassword

nusoap_client::$proxypassword = ''

Definition at line 7247 of file nusoap.php.

◆ $proxyport

nusoap_client::$proxyport = ''

Definition at line 7245 of file nusoap.php.

◆ $proxyusername

nusoap_client::$proxyusername = ''

Definition at line 7246 of file nusoap.php.

◆ $request

nusoap_client::$request = ''

Definition at line 7255 of file nusoap.php.

◆ $requestHeaders

nusoap_client::$requestHeaders = false

Definition at line 7238 of file nusoap.php.

◆ $response

nusoap_client::$response = ''

Definition at line 7256 of file nusoap.php.

◆ $response_timeout

nusoap_client::$response_timeout = 30

Definition at line 7251 of file nusoap.php.

◆ $responseData

nusoap_client::$responseData = ''

Definition at line 7257 of file nusoap.php.

◆ $responseHeader

nusoap_client::$responseHeader = null

Definition at line 7240 of file nusoap.php.

◆ $responseHeaders

nusoap_client::$responseHeaders = ''

Definition at line 7239 of file nusoap.php.

◆ $return

nusoap_client::$return

Definition at line 7229 of file nusoap.php.

◆ $timeout

nusoap_client::$timeout = 0

Definition at line 7250 of file nusoap.php.

◆ $use_curl

nusoap_client::$use_curl = false

Definition at line 7263 of file nusoap.php.

◆ $username

nusoap_client::$username = ''

Definition at line 7234 of file nusoap.php.

◆ $wsdl

nusoap_client::$wsdl

Definition at line 7230 of file nusoap.php.

◆ $wsdlFile

nusoap_client::$wsdlFile

Definition at line 7231 of file nusoap.php.

◆ $xml_encoding

nusoap_client::$xml_encoding = ''

Definition at line 7248 of file nusoap.php.


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