ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
nusoap_base Class Reference

nusoap_base More...

+ Inheritance diagram for nusoap_base:
+ Collaboration diagram for nusoap_base:

Public Member Functions

 debug ($string)
 adds debug data to the class level debug string 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')
 
 serializeEnvelope ($body, $headers=false, $namespaces=array(), $style='rpc', $use='encoded')
 serialize message More...
 
 formatDump ($str)
 
 contractQname ($qname)
 contracts a qualified name More...
 
 expandQname ($qname)
 expands 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 returns false if no namespace registered with the given prefix More...
 
 getPrefixFromNamespace ($ns)
 returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace More...
 
 varDump ($data)
 
 __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)
 
 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

 $title = 'NuSOAP'
 
 $version = '0.6.7'
 
 $revision = '$Revision$'
 
 $error_str = false
 Current error string (manipulated by getError/setError) More...
 
 $debug_str = ''
 Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment) More...
 
 $charencoding = true
 
 $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'
 
 $soap_defencoding = 'UTF-8'
 
 $namespaces
 
 $usedNamespaces = array()
 
 $typemap
 
 $xmlEntities
 
 $debugLevel
 

Detailed Description

nusoap_base

Author
Dietrich Ayala dietr.nosp@m.ich@.nosp@m.ganx4.nosp@m..com
Version
$Id$ @access public
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$ @access public

Definition at line 61 of file nusoap.php.

Constructor & Destructor Documentation

◆ __construct()

nusoap_base::__construct ( )

constructor

@access public

Definition at line 232 of file nusoap.php.

232 {
233 $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel;
234 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS.

Member Function Documentation

◆ __toString()

nusoap_base::__toString ( )

represents the object as a string

Returns
string @access public

Definition at line 894 of file nusoap.php.

894 {
895 return $this->varDump($this);
896 }
varDump($data)
Definition: nusoap.php:567

References varDump().

+ Here is the call graph for this function:

◆ appendDebug()

◆ clearDebug()

nusoap_base::clearDebug ( )

clears the current debug data for this instance

@access public

Definition at line 307 of file nusoap.php.

307 {
308 // it would be nice to use a memory stream here to use
309 // memory more efficiently
310 $this->debug_str = '';
311 }

Referenced by nusoap_server\__construct(), nusoap_client\call(), nusoap_client\checkWSDL(), and nusoap_server\serialize_return().

+ Here is the caller graph for this function:

◆ contractQname() [1/2]

nusoap_base::contractQname (   $qname)

contracts a qualified name

Parameters
string$stringqname
Returns
string contracted qname @access private

Definition at line 458 of file nusoap.php.

458 {
459 // get element namespace
460 //$this->xdebug("Contract $qname");
461 if (strrpos($qname, ':')) {
462 // get unqualified name
463 $name = substr($qname, strrpos($qname, ':') + 1);
464 // get ns
465 $ns = substr($qname, 0, strrpos($qname, ':'));
466 $p = $this->getPrefixFromNamespace($ns);
467 if ($p) {
468 return $p . ':' . $name;
469 }
470 return $qname;
471 } else {
472 return $qname;
473 }
474 }
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:557

References getPrefixFromNamespace().

+ Here is the call graph for this function:

◆ contractQname() [2/2]

nusoap_base::contractQname (   $qname)

contracts (changes namespace to prefix) a qualified name

Parameters
string$qnameqname
Returns
string contracted qname @access private

Definition at line 747 of file nusoap.php.

747 {
748 // get element namespace
749 //$this->xdebug("Contract $qname");
750 if (strrpos($qname, ':')) {
751 // get unqualified name
752 $name = substr($qname, strrpos($qname, ':') + 1);
753 // get ns
754 $ns = substr($qname, 0, strrpos($qname, ':'));
755 $p = $this->getPrefixFromNamespace($ns);
756 if ($p) {
757 return $p . ':' . $name;
758 }
759 return $qname;
760 } else {
761 return $qname;
762 }
763 }

References getPrefixFromNamespace().

+ Here is the call graph for this function:

◆ debug() [1/2]

nusoap_base::debug (   $string)

adds debug data to the class level debug string

Parameters
string$stringdebug data @access private

Definition at line 144 of file nusoap.php.

144 {
145 $this->debug_str .= get_class($this).": $string\n";
146 }

Referenced by nusoap_client\__construct(), nusoap_xmlschema\__construct(), soap_transport_http\__construct(), wsdl\__construct(), nusoap_server\__construct(), nusoap_parser\__construct(), nusoap_client\_getProxyClassCode(), soap_transport_http\buildPayload(), soap_parser\buildVal(), nusoap_parser\buildVal(), soap_client\call(), nusoap_client\call(), nusoap_client\checkCookies(), nusoap_client\checkWSDL(), soap_transport_http\connect(), soap_transport_http\decodeChunked(), nusoap_parser\decodeSimple(), wsdl\end_element(), wsdl\fetchWSDL(), soap_transport_http\getCookiesForRequest(), soap_client\getOperationData(), nusoap_client\getOperationData(), nusoap_client\getProxy(), soap_transport_http\getResponse(), wsdl\getTypeDef(), soap_server\invoke_method(), nusoap_server\invoke_method(), nusoap_client\loadWSDL(), wsdl\parametersMatchWrapped(), soap_server\parse_http_headers(), nusoap_server\parse_http_headers(), soap_server\parse_request(), nusoap_server\parse_request(), XMLSchema\parseFile(), nusoap_xmlschema\parseFile(), nusoap_server\parseRequest(), soap_client\parseResponse(), nusoap_client\parseResponse(), XMLSchema\parseString(), nusoap_xmlschema\parseString(), wsdl\parseWSDL(), soap_transport_http\send(), soap_client\send(), nusoap_client\send(), soap_server\send_response(), nusoap_server\send_response(), soap_transport_http\sendRequest(), soap_server\serialize_return(), nusoap_server\serialize_return(), serialize_val(), wsdl\serializeComplexTypeAttributes(), wsdl\serializeComplexTypeElements(), serializeEnvelope(), wsdl\serializeParameters(), wsdl\serializeRPCParameters(), wsdl\serializeType(), nusoap_server\service(), wsdl\setCredentials(), nusoap_client\setCredentials(), soap_transport_http\setCredentials(), soap_transport_http\setCurlOption(), nusoap_client\setCurlOption(), nusoap_client\setEndpoint(), soap_transport_http\setHeader(), nusoap_client\setHeaders(), nusoap_client\setHTTPEncoding(), soap_transport_http\setProxy(), soap_transport_http\setURL(), nusoap_client\setUseCURL(), soap_client\soap_client(), soap_parser\soap_parser(), soap_server\soap_server(), soap_transport_http\soap_transport_http(), wsdl\start_element(), soap_parser\start_element(), nusoap_parser\start_element(), soap_transport_http\unsetHeader(), nusoap_client\UpdateCookies(), nusoap_client\useHTTPPersistentConnection(), wsdl\wsdl(), XMLSchema\xdebug(), nusoap_xmlschema\xdebug(), and XMLSchema\XMLSchema().

+ Here is the caller graph for this function:

◆ debug() [2/2]

nusoap_base::debug (   $string)

adds debug data to the instance debug string with formatting

Parameters
string$stringdebug data @access private

Definition at line 282 of file nusoap.php.

282 {
283 if ($this->debugLevel > 0) {
284 $this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n");
285 }
286 }
getmicrotime()
returns the time in ODBC canonical form with microseconds
Definition: nusoap.php:861
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:294

References appendDebug(), and getmicrotime().

+ Here is the call graph for this function:

◆ expandEntities() [1/2]

nusoap_base::expandEntities (   $val)

expands entities, e.g.

changes '<' to '<'.

Parameters
string$valThe string in which to expand entities. @access private

Definition at line 154 of file nusoap.php.

154 {
155 if ($this->charencoding) {
156 $val = str_replace('&', '&amp;', $val);
157 $val = str_replace("'", '&apos;', $val);
158 $val = str_replace('"', '&quot;', $val);
159 $val = str_replace('<', '&lt;', $val);
160 $val = str_replace('>', '&gt;', $val);
161 }
162 return $val;
163 }

Referenced by serialize_val(), wsdl\serializeComplexTypeAttributes(), and wsdl\serializeType().

+ Here is the caller graph for this function:

◆ expandEntities() [2/2]

nusoap_base::expandEntities (   $val)

expands entities, e.g.

changes '<' to '<'.

Parameters
string$valThe string in which to expand entities. @access private

Definition at line 348 of file nusoap.php.

348 {
349 if ($this->charencoding) {
350 $val = str_replace('&', '&amp;', $val);
351 $val = str_replace("'", '&apos;', $val);
352 $val = str_replace('"', '&quot;', $val);
353 $val = str_replace('<', '&lt;', $val);
354 $val = str_replace('>', '&gt;', $val);
355 }
356 return $val;
357 }

◆ expandQname() [1/2]

nusoap_base::expandQname (   $qname)

expands a qualified name

Parameters
string$stringqname
Returns
string expanded qname @access private

Definition at line 483 of file nusoap.php.

483 {
484 // get element prefix
485 if(strpos($qname,':') && !ereg('^http://',$qname)){
486 // get unqualified name
487 $name = substr(strstr($qname,':'),1);
488 // get ns prefix
489 $prefix = substr($qname,0,strpos($qname,':'));
490 if(isset($this->namespaces[$prefix])){
491 return $this->namespaces[$prefix].':'.$name;
492 } else {
493 return $qname;
494 }
495 } else {
496 return $qname;
497 }
498 }

Referenced by wsdl\addComplexType(), wsdl\addSimpleType(), XMLSchema\schemaStartElement(), nusoap_xmlschema\schemaStartElement(), and wsdl\start_element().

+ Here is the caller graph for this function:

◆ expandQname() [2/2]

nusoap_base::expandQname (   $qname)

expands (changes prefix to namespace) a qualified name

Parameters
string$qnameqname
Returns
string expanded qname @access private

Definition at line 772 of file nusoap.php.

772 {
773 // get element prefix
774 if(strpos($qname,':') && !preg_match('/^http:\/\//',$qname)){
775 // get unqualified name
776 $name = substr(strstr($qname,':'),1);
777 // get ns prefix
778 $prefix = substr($qname,0,strpos($qname,':'));
779 if(isset($this->namespaces[$prefix])){
780 return $this->namespaces[$prefix].':'.$name;
781 } else {
782 return $qname;
783 }
784 } else {
785 return $qname;
786 }
787 }

◆ formatDump() [1/2]

nusoap_base::formatDump (   $str)

Definition at line 446 of file nusoap.php.

446 {
447 $str = htmlspecialchars($str);
448 return nl2br($str);
449 }

◆ formatDump() [2/2]

nusoap_base::formatDump (   $str)

formats a string to be inserted into an HTML stream

Parameters
string$strThe string to format
Returns
string The formatted string @access public
Deprecated:

Definition at line 735 of file nusoap.php.

735 {
736 $str = htmlspecialchars($str);
737 return nl2br($str);
738 }

◆ getDebug()

& nusoap_base::getDebug ( )

gets the current debug data for this instance

Returns
debug data @access public

Definition at line 319 of file nusoap.php.

319 {
320 // it would be nice to use a memory stream here to use
321 // memory more efficiently
322 return $this->debug_str;
323 }
$debug_str
Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment)
Definition: nusoap.php:67

References $debug_str.

Referenced by nusoap_server\__construct(), nusoap_client\call(), nusoap_client\checkWSDL(), nusoap_server\fault(), and nusoap_server\serialize_return().

+ Here is the caller graph for this function:

◆ getDebugAsXMLComment()

& nusoap_base::getDebugAsXMLComment ( )

gets the current debug data for this instance as an XML comment this may change the contents of the debug data

Returns
debug data as an XML comment @access public

Definition at line 332 of file nusoap.php.

332 {
333 // it would be nice to use a memory stream here to use
334 // memory more efficiently
335 while (strpos($this->debug_str, '--')) {
336 $this->debug_str = str_replace('--', '- -', $this->debug_str);
337 }
338 $ret = "<!--\n" . $this->debug_str . "\n-->";
339 return $ret;
340 }
$ret
Definition: parser.php:6

References $ret.

Referenced by nusoap_server\send_response(), and nusoap_server\service().

+ Here is the caller graph for this function:

◆ getDebugLevel()

nusoap_base::getDebugLevel ( )

gets the debug level for this instance

Returns
int Debug level 0-9, where 0 turns off @access public

Definition at line 262 of file nusoap.php.

262 {
263 return $this->debugLevel;
264 }

References $debugLevel.

◆ getError() [1/2]

nusoap_base::getError ( )

returns error string if present

Returns
boolean $string error string @access public

Definition at line 171 of file nusoap.php.

171 {
172 if($this->error_str != ''){
173 return $this->error_str;
174 }
175 return false;
176 }
$error_str
Current error string (manipulated by getError/setError)
Definition: nusoap.php:66

References $error_str.

Referenced by nusoap_server\__construct(), nusoap_client\_getProxyClassCode(), soap_client\call(), nusoap_client\call(), nusoap_client\checkWSDL(), nusoap_client\getOperationData(), nusoap_client\getProxy(), wsdl\parseWSDL(), soap_client\send(), nusoap_client\send(), soap_server\serialize_return(), nusoap_server\serialize_return(), soap_client\soap_client(), and soap_server\soap_server().

+ Here is the caller graph for this function:

◆ getError() [2/2]

nusoap_base::getError ( )

returns error string if present

Returns
mixed error string or false @access public

Definition at line 365 of file nusoap.php.

365 {
366 if($this->error_str != ''){
367 return $this->error_str;
368 }
369 return false;
370 }

References $error_str.

◆ getGlobalDebugLevel()

nusoap_base::getGlobalDebugLevel ( )

gets the global debug level, which applies to future instances

Returns
integer Debug level 0-9, where 0 turns off @access public

Definition at line 242 of file nusoap.php.

242 {
243 return $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel;
244 }

References $GLOBALS.

◆ getLocalPart() [1/2]

nusoap_base::getLocalPart (   $str)

returns the local part of a prefixed string returns the original string, if not prefixed

Parameters
string
Returns
string @access public

Definition at line 508 of file nusoap.php.

508 {
509 if($sstr = strrchr($str,':')){
510 // get unqualified name
511 return substr( $sstr, 1 );
512 } else {
513 return $str;
514 }
515 }

Referenced by wsdl\addOperation(), nusoap_xmlschema\schemaEndElement(), XMLSchema\schemaStartElement(), nusoap_xmlschema\schemaStartElement(), wsdl\serialize(), wsdl\serializeComplexTypeAttributes(), wsdl\serializeComplexTypeElements(), wsdl\serializeType(), wsdl\start_element(), soap_parser\start_element(), and nusoap_parser\start_element().

+ Here is the caller graph for this function:

◆ getLocalPart() [2/2]

nusoap_base::getLocalPart (   $str)

returns the local part of a prefixed string returns the original string, if not prefixed

Parameters
string$strThe prefixed string
Returns
string The local part @access public

Definition at line 797 of file nusoap.php.

797 {
798 if($sstr = strrchr($str,':')){
799 // get unqualified name
800 return substr( $sstr, 1 );
801 } else {
802 return $str;
803 }
804 }

◆ getmicrotime()

nusoap_base::getmicrotime ( )

returns the time in ODBC canonical form with microseconds

Returns
string The time in ODBC canonical form with microseconds @access public

Definition at line 861 of file nusoap.php.

861 {
862 if (function_exists('gettimeofday')) {
863 $tod = gettimeofday();
864 $sec = $tod['sec'];
865 $usec = $tod['usec'];
866 } else {
867 $sec = time();
868 $usec = 0;
869 }
870 return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec);
871 }
sprintf('%.4f', $callTime)

References sprintf.

Referenced by debug().

+ Here is the caller graph for this function:

◆ getNamespaceFromPrefix() [1/2]

nusoap_base::getNamespaceFromPrefix (   $prefix)

pass it a prefix, it returns a namespace returns false if no namespace registered with the given prefix

Parameters
string
Returns
mixed @access public

Definition at line 541 of file nusoap.php.

541 {
542 if (isset($this->namespaces[$prefix])) {
543 return $this->namespaces[$prefix];
544 }
545 //$this->setError("No namespace registered for prefix '$prefix'");
546 return false;
547 }

Referenced by wsdl\addOperation(), wsdl\parametersMatchWrapped(), XMLSchema\schemaStartElement(), nusoap_xmlschema\schemaStartElement(), wsdl\serialize(), wsdl\serializeComplexTypeAttributes(), wsdl\serializeComplexTypeElements(), and wsdl\serializeType().

+ Here is the caller graph for this function:

◆ getNamespaceFromPrefix() [2/2]

nusoap_base::getNamespaceFromPrefix (   $prefix)

pass it a prefix, it returns a namespace

Parameters
string$prefixThe prefix
Returns
mixed The namespace, false if no namespace has the specified prefix @access public

Definition at line 829 of file nusoap.php.

829 {
830 if (isset($this->namespaces[$prefix])) {
831 return $this->namespaces[$prefix];
832 }
833 //$this->setError("No namespace registered for prefix '$prefix'");
834 return false;
835 }

◆ getPrefix() [1/2]

nusoap_base::getPrefix (   $str)

returns the prefix part of a prefixed string returns false, if not prefixed

Parameters
string
Returns
mixed @access public

Definition at line 525 of file nusoap.php.

525 {
526 if($pos = strrpos($str,':')){
527 // get prefix
528 return substr($str,0,$pos);
529 }
530 return false;
531 }

Referenced by nusoap_xmlschema\addElement(), wsdl\addOperation(), nusoap_xmlschema\schemaEndElement(), XMLSchema\schemaStartElement(), nusoap_xmlschema\schemaStartElement(), wsdl\serialize(), wsdl\serializeComplexTypeAttributes(), wsdl\serializeComplexTypeElements(), wsdl\serializeType(), soap_parser\start_element(), and nusoap_parser\start_element().

+ Here is the caller graph for this function:

◆ getPrefix() [2/2]

nusoap_base::getPrefix (   $str)

returns the prefix part of a prefixed string returns false, if not prefixed

Parameters
string$strThe prefixed string
Returns
mixed The prefix or false if there is no prefix @access public

Definition at line 814 of file nusoap.php.

814 {
815 if($pos = strrpos($str,':')){
816 // get prefix
817 return substr($str,0,$pos);
818 }
819 return false;
820 }

◆ getPrefixFromNamespace() [1/2]

nusoap_base::getPrefixFromNamespace (   $ns)

returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace

Parameters
string
Returns
mixed @access public

Definition at line 557 of file nusoap.php.

557 {
558 foreach ($this->namespaces as $p => $n) {
559 if ($ns == $n || $ns == $p) {
560 $this->usedNamespaces[$p] = $n;
561 return $p;
562 }
563 }
564 return false;
565 }
$n
Definition: RandomTest.php:80

References $n.

Referenced by soap_client\call(), nusoap_client\call(), contractQname(), XMLSchema\schemaStartElement(), nusoap_xmlschema\schemaStartElement(), wsdl\serialize(), XMLSchema\serializeSchema(), nusoap_xmlschema\serializeSchema(), wsdl\serializeType(), and wsdl\start_element().

+ Here is the caller graph for this function:

◆ getPrefixFromNamespace() [2/2]

nusoap_base::getPrefixFromNamespace (   $ns)

returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace

Parameters
string$nsThe namespace
Returns
mixed The prefix, false if the namespace has no prefixes @access public

Definition at line 845 of file nusoap.php.

845 {
846 foreach ($this->namespaces as $p => $n) {
847 if ($ns == $n || $ns == $p) {
848 $this->usedNamespaces[$p] = $n;
849 return $p;
850 }
851 }
852 return false;
853 }

References $n.

◆ isArraySimpleOrStruct() [1/2]

nusoap_base::isArraySimpleOrStruct (   $val)

detect if array is a simple array or a struct (associative array)

Parameters
$valThe PHP array
Returns
string (arraySimple|arrayStruct) @access private

Definition at line 195 of file nusoap.php.

195 {
196 $keyList = array_keys($val);
197 foreach ($keyList as $keyListValue) {
198 if (!is_int($keyListValue)) {
199 return 'arrayStruct';
200 }
201 }
202 return 'arraySimple';
203 }

Referenced by wsdl\parametersMatchWrapped(), serialize_val(), wsdl\serializeComplexTypeElements(), wsdl\serializeParameters(), wsdl\serializeRPCParameters(), and wsdl\serializeType().

+ Here is the caller graph for this function:

◆ isArraySimpleOrStruct() [2/2]

nusoap_base::isArraySimpleOrStruct (   $val)

detect if array is a simple array or a struct (associative array)

Parameters
mixed$valThe PHP array
Returns
string (arraySimple|arrayStruct) @access private

Definition at line 389 of file nusoap.php.

389 {
390 $keyList = array_keys($val);
391 foreach ($keyList as $keyListValue) {
392 if (!is_int($keyListValue)) {
393 return 'arrayStruct';
394 }
395 }
396 return 'arraySimple';
397 }

◆ serialize_val() [1/2]

nusoap_base::serialize_val (   $val,
  $name = false,
  $type = false,
  $name_ns = false,
  $type_ns = false,
  $attributes = false,
  $use = 'encoded' 
)
serializes PHP values in accordance w/ section 5. Type information is
not serialized if $use == 'literal'.

@return     string

@access public

Definition at line 212 of file nusoap.php.

212 {
213 if(is_object($val) && get_class($val) == 'soapval'){
214 return $val->serialize($use);
215 }
216 $this->debug( "in serialize_val: $val, $name, $type, $name_ns, $type_ns, $attributes, $use");
217 // if no name, use item
218 $name = (!$name|| is_numeric($name)) ? 'soapVal' : $name;
219 // if name has ns, add ns prefix to name
220 $xmlns = '';
221 if($name_ns){
222 $prefix = 'nu'.rand(1000,9999);
223 $name = $prefix.':'.$name;
224 $xmlns .= " xmlns:$prefix=\"$name_ns\"";
225 }
226 // if type is prefixed, create type prefix
227 if($type_ns != '' && $type_ns == $this->namespaces['xsd']){
228 // need to fix this. shouldn't default to xsd if no ns specified
229 // w/o checking against typemap
230 $type_prefix = 'xsd';
231 } elseif($type_ns){
232 $type_prefix = 'ns'.rand(1000,9999);
233 $xmlns .= " xmlns:$type_prefix=\"$type_ns\"";
234 }
235 // serialize attributes if present
236 $atts = '';
237 if($attributes){
238 foreach($attributes as $k => $v){
239 $atts .= " $k=\"$v\"";
240 }
241 }
242 // serialize if an xsd built-in primitive type
243 if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){
244 if (is_bool($val)) {
245 if ($type == 'boolean') {
246 $val = $val ? 'true' : 'false';
247 } elseif (! $val) {
248 $val = 0;
249 }
250 } else if (is_string($val)) {
251 $val = $this->expandEntities($val);
252 }
253 if ($use == 'literal') {
254 return "<$name$xmlns>$val</$name>";
255 } else {
256 return "<$name$xmlns xsi:type=\"xsd:$type\">$val</$name>";
257 }
258 }
259 // detect type and serialize
260 $xml = '';
261 switch(true) {
262 case ($type == '' && is_null($val)):
263 if ($use == 'literal') {
264 // TODO: depends on nillable
265 $xml .= "<$name$xmlns/>";
266 } else {
267 $xml .= "<$name$xmlns xsi:nil=\"true\"/>";
268 }
269 break;
270 case (is_bool($val) || $type == 'boolean'):
271 if ($type == 'boolean') {
272 $val = $val ? 'true' : 'false';
273 } elseif (! $val) {
274 $val = 0;
275 }
276 if ($use == 'literal') {
277 $xml .= "<$name$xmlns $atts>$val</$name>";
278 } else {
279 $xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val</$name>";
280 }
281 break;
282 case (is_int($val) || is_long($val) || $type == 'int'):
283 if ($use == 'literal') {
284 $xml .= "<$name$xmlns $atts>$val</$name>";
285 } else {
286 $xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val</$name>";
287 }
288 break;
289 case (is_float($val)|| is_double($val) || $type == 'float'):
290 if ($use == 'literal') {
291 $xml .= "<$name$xmlns $atts>$val</$name>";
292 } else {
293 $xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val</$name>";
294 }
295 break;
296 case (is_string($val) || $type == 'string'):
297 $val = $this->expandEntities($val);
298 if ($use == 'literal') {
299 $xml .= "<$name$xmlns $atts>$val</$name>";
300 } else {
301 $xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val</$name>";
302 }
303 break;
304 case is_object($val):
305 $name = get_class($val);
306 foreach(get_object_vars($val) as $k => $v){
307 $pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use);
308 }
309 $xml .= '<'.$name.'>'.$pXml.'</'.$name.'>';
310 break;
311 break;
312 case (is_array($val) || $type):
313 // detect if struct or array
314 $valueType = $this->isArraySimpleOrStruct($val);
315 if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
316 $i = 0;
317 if(is_array($val) && count($val)> 0){
318 foreach($val as $v){
319 if(is_object($v) && get_class($v) == 'soapval'){
320 $tt_ns = $v->type_ns;
321 $tt = $v->type;
322 } elseif (is_array($v)) {
323 $tt = $this->isArraySimpleOrStruct($v);
324 } else {
325 $tt = gettype($v);
326 }
327 $array_types[$tt] = 1;
328 $xml .= $this->serialize_val($v,'item',false,false,false,false,$use);
329 ++$i;
330 }
331 if(count($array_types) > 1){
332 $array_typename = 'xsd:ur-type';
333 } elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) {
334 if ($tt == 'integer') {
335 $tt = 'int';
336 }
337 $array_typename = 'xsd:'.$tt;
338 } elseif(isset($tt) && $tt == 'arraySimple'){
339 $array_typename = 'SOAP-ENC:Array';
340 } elseif(isset($tt) && $tt == 'arrayStruct'){
341 $array_typename = 'unnamed_struct_use_soapval';
342 } else {
343 // if type is prefixed, create type prefix
344 if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){
345 $array_typename = 'xsd:' . $tt;
346 } elseif ($tt_ns) {
347 $tt_prefix = 'ns' . rand(1000, 9999);
348 $array_typename = "$tt_prefix:$tt";
349 $xmlns .= " xmlns:$tt_prefix=\"$tt_ns\"";
350 } else {
351 $array_typename = $tt;
352 }
353 }
354 $array_type = $i;
355 if ($use == 'literal') {
356 $type_str = '';
357 } else if (isset($type) && isset($type_prefix)) {
358 $type_str = " xsi:type=\"$type_prefix:$type\"";
359 } else {
360 $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\"";
361 }
362 // empty array
363 } else {
364 if ($use == 'literal') {
365 $type_str = '';
366 } else if (isset($type) && isset($type_prefix)) {
367 $type_str = " xsi:type=\"$type_prefix:$type\"";
368 } else {
369 $type_str = " xsi:type=\"SOAP-ENC:Array\"";
370 }
371 }
372 $xml = "<$name$xmlns$type_str$atts>".$xml."</$name>";
373 } else {
374 // got a struct
375 if(isset($type) && isset($type_prefix)){
376 $type_str = " xsi:type=\"$type_prefix:$type\"";
377 } else {
378 $type_str = '';
379 }
380 if ($use == 'literal') {
381 $xml .= "<$name$xmlns $atts>";
382 } else {
383 $xml .= "<$name$xmlns$type_str$atts>";
384 }
385 foreach($val as $k => $v){
386 // Apache Map
387 if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') {
388 $xml .= '<item>';
389 $xml .= $this->serialize_val($k,'key',false,false,false,false,$use);
390 $xml .= $this->serialize_val($v,'value',false,false,false,false,$use);
391 $xml .= '</item>';
392 } else {
393 $xml .= $this->serialize_val($v,$k,false,false,false,false,$use);
394 }
395 }
396 $xml .= "</$name>";
397 }
398 break;
399 default:
400 $xml .= 'not detected, got '.gettype($val).' for '.$val;
401 break;
402 }
403 return $xml;
404 }
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
serialize_val($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded')
Definition: nusoap.php:212
expandEntities($val)
expands entities, e.g.
Definition: nusoap.php:154
isArraySimpleOrStruct($val)
detect if array is a simple array or a struct (associative array)
Definition: nusoap.php:195

References debug(), expandEntities(), isArraySimpleOrStruct(), and serialize_val().

Referenced by soap_client\call(), nusoap_client\call(), soapval\serialize(), nusoap_fault\serialize(), soap_server\serialize_return(), nusoap_server\serialize_return(), serialize_val(), wsdl\serializeComplexTypeElements(), serializeEnvelope(), and wsdl\serializeType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_val() [2/2]

nusoap_base::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. Type information is
not serialized if $use == 'literal'.

@param      mixed   $val    The value to serialize
@param      string  $name   The name (local part) of the XML element
@param      string  $type   The XML schema type (local part) for the element
@param      string  $name_ns        The namespace for the name of the XML element
@param      string  $type_ns        The namespace for the type of the element
@param      array   $attributes     The attributes to serialize as name=>value pairs
@param      string  $use    The WSDL "use" (encoded|literal)
@param      boolean $soapval        Whether this is called from soapval.
@return     string  The serialized element, possibly with child elements

@access public

Definition at line 414 of file nusoap.php.

414 {
415 $this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use, soapval=$soapval");
416 $this->appendDebug('value=' . $this->varDump($val));
417 $this->appendDebug('attributes=' . $this->varDump($attributes));
418
419 if (is_object($val) && get_class($val) == 'soapval' && (! $soapval)) {
420 $this->debug("serialize_val: serialize soapval");
421 $xml = $val->serialize($use);
422 $this->appendDebug($val->getDebug());
423 $val->clearDebug();
424 $this->debug("serialize_val of soapval returning $xml");
425 return $xml;
426 }
427 // force valid name if necessary
428 if (is_numeric($name)) {
429 $name = '__numeric_' . $name;
430 } elseif (! $name) {
431 $name = 'noname';
432 }
433 // if name has ns, add ns prefix to name
434 $xmlns = '';
435 if($name_ns){
436 $prefix = 'nu'.rand(1000,9999);
437 $name = $prefix.':'.$name;
438 $xmlns .= " xmlns:$prefix=\"$name_ns\"";
439 }
440 // if type is prefixed, create type prefix
441 if($type_ns != '' && $type_ns == $this->namespaces['xsd']){
442 // need to fix this. shouldn't default to xsd if no ns specified
443 // w/o checking against typemap
444 $type_prefix = 'xsd';
445 } elseif($type_ns){
446 $type_prefix = 'ns'.rand(1000,9999);
447 $xmlns .= " xmlns:$type_prefix=\"$type_ns\"";
448 }
449 // serialize attributes if present
450 $atts = '';
451 if($attributes){
452 foreach($attributes as $k => $v){
453 $atts .= " $k=\"".$this->expandEntities($v).'"';
454 }
455 }
456 // serialize null value
457 if (is_null($val)) {
458 $this->debug("serialize_val: serialize null");
459 if ($use == 'literal') {
460 // TODO: depends on minOccurs
461 $xml = "<$name$xmlns$atts/>";
462 $this->debug("serialize_val returning $xml");
463 return $xml;
464 } else {
465 if (isset($type) && isset($type_prefix)) {
466 $type_str = " xsi:type=\"$type_prefix:$type\"";
467 } else {
468 $type_str = '';
469 }
470 $xml = "<$name$xmlns$type_str$atts xsi:nil=\"true\"/>";
471 $this->debug("serialize_val returning $xml");
472 return $xml;
473 }
474 }
475 // serialize if an xsd built-in primitive type
476 if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){
477 $this->debug("serialize_val: serialize xsd built-in primitive type");
478 if (is_bool($val)) {
479 if ($type == 'boolean') {
480 $val = $val ? 'true' : 'false';
481 } elseif (! $val) {
482 $val = 0;
483 }
484 } else if (is_string($val)) {
485 $val = $this->expandEntities($val);
486 }
487 if ($use == 'literal') {
488 $xml = "<$name$xmlns$atts>$val</$name>";
489 $this->debug("serialize_val returning $xml");
490 return $xml;
491 } else {
492 $xml = "<$name$xmlns xsi:type=\"xsd:$type\"$atts>$val</$name>";
493 $this->debug("serialize_val returning $xml");
494 return $xml;
495 }
496 }
497 // detect type and serialize
498 $xml = '';
499 switch(true) {
500 case (is_bool($val) || $type == 'boolean'):
501 $this->debug("serialize_val: serialize boolean");
502 if ($type == 'boolean') {
503 $val = $val ? 'true' : 'false';
504 } elseif (! $val) {
505 $val = 0;
506 }
507 if ($use == 'literal') {
508 $xml .= "<$name$xmlns$atts>$val</$name>";
509 } else {
510 $xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val</$name>";
511 }
512 break;
513 case (is_int($val) || is_long($val) || $type == 'int'):
514 $this->debug("serialize_val: serialize int");
515 if ($use == 'literal') {
516 $xml .= "<$name$xmlns$atts>$val</$name>";
517 } else {
518 $xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val</$name>";
519 }
520 break;
521 case (is_float($val)|| is_double($val) || $type == 'float'):
522 $this->debug("serialize_val: serialize float");
523 if ($use == 'literal') {
524 $xml .= "<$name$xmlns$atts>$val</$name>";
525 } else {
526 $xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val</$name>";
527 }
528 break;
529 case (is_string($val) || $type == 'string'):
530 $this->debug("serialize_val: serialize string");
531 $val = $this->expandEntities($val);
532 if ($use == 'literal') {
533 $xml .= "<$name$xmlns$atts>$val</$name>";
534 } else {
535 $xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val</$name>";
536 }
537 break;
538 case is_object($val):
539 $this->debug("serialize_val: serialize object");
540 if (get_class($val) == 'soapval') {
541 $this->debug("serialize_val: serialize soapval object");
542 $pXml = $val->serialize($use);
543 $this->appendDebug($val->getDebug());
544 $val->clearDebug();
545 } else {
546 if (! $name) {
547 $name = get_class($val);
548 $this->debug("In serialize_val, used class name $name as element name");
549 } else {
550 $this->debug("In serialize_val, do not override name $name for element name for class " . get_class($val));
551 }
552 foreach(get_object_vars($val) as $k => $v){
553 $pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use);
554 }
555 }
556 if(isset($type) && isset($type_prefix)){
557 $type_str = " xsi:type=\"$type_prefix:$type\"";
558 } else {
559 $type_str = '';
560 }
561 if ($use == 'literal') {
562 $xml .= "<$name$xmlns$atts>$pXml</$name>";
563 } else {
564 $xml .= "<$name$xmlns$type_str$atts>$pXml</$name>";
565 }
566 break;
567 break;
568 case (is_array($val) || $type):
569 // detect if struct or array
570 $valueType = $this->isArraySimpleOrStruct($val);
571 if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){
572 $this->debug("serialize_val: serialize array");
573 $i = 0;
574 if(is_array($val) && count($val)> 0){
575 foreach($val as $v){
576 if(is_object($v) && get_class($v) == 'soapval'){
577 $tt_ns = $v->type_ns;
578 $tt = $v->type;
579 } elseif (is_array($v)) {
580 $tt = $this->isArraySimpleOrStruct($v);
581 } else {
582 $tt = gettype($v);
583 }
584 $array_types[$tt] = 1;
585 // TODO: for literal, the name should be $name
586 $xml .= $this->serialize_val($v,'item',false,false,false,false,$use);
587 ++$i;
588 }
589 if(count($array_types) > 1){
590 $array_typename = 'xsd:anyType';
591 } elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) {
592 if ($tt == 'integer') {
593 $tt = 'int';
594 }
595 $array_typename = 'xsd:'.$tt;
596 } elseif(isset($tt) && $tt == 'arraySimple'){
597 $array_typename = 'SOAP-ENC:Array';
598 } elseif(isset($tt) && $tt == 'arrayStruct'){
599 $array_typename = 'unnamed_struct_use_soapval';
600 } else {
601 // if type is prefixed, create type prefix
602 if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){
603 $array_typename = 'xsd:' . $tt;
604 } elseif ($tt_ns) {
605 $tt_prefix = 'ns' . rand(1000, 9999);
606 $array_typename = "$tt_prefix:$tt";
607 $xmlns .= " xmlns:$tt_prefix=\"$tt_ns\"";
608 } else {
609 $array_typename = $tt;
610 }
611 }
612 $array_type = $i;
613 if ($use == 'literal') {
614 $type_str = '';
615 } else if (isset($type) && isset($type_prefix)) {
616 $type_str = " xsi:type=\"$type_prefix:$type\"";
617 } else {
618 $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\"";
619 }
620 // empty array
621 } else {
622 if ($use == 'literal') {
623 $type_str = '';
624 } else if (isset($type) && isset($type_prefix)) {
625 $type_str = " xsi:type=\"$type_prefix:$type\"";
626 } else {
627 $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\"";
628 }
629 }
630 // TODO: for array in literal, there is no wrapper here
631 $xml = "<$name$xmlns$type_str$atts>".$xml."</$name>";
632 } else {
633 // got a struct
634 $this->debug("serialize_val: serialize struct");
635 if(isset($type) && isset($type_prefix)){
636 $type_str = " xsi:type=\"$type_prefix:$type\"";
637 } else {
638 $type_str = '';
639 }
640 if ($use == 'literal') {
641 $xml .= "<$name$xmlns$atts>";
642 } else {
643 $xml .= "<$name$xmlns$type_str$atts>";
644 }
645 foreach($val as $k => $v){
646 // Apache Map
647 if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') {
648 $xml .= '<item>';
649 $xml .= $this->serialize_val($k,'key',false,false,false,false,$use);
650 $xml .= $this->serialize_val($v,'value',false,false,false,false,$use);
651 $xml .= '</item>';
652 } else {
653 $xml .= $this->serialize_val($v,$k,false,false,false,false,$use);
654 }
655 }
656 $xml .= "</$name>";
657 }
658 break;
659 default:
660 $this->debug("serialize_val: serialize unknown");
661 $xml .= 'not detected, got '.gettype($val).' for '.$val;
662 break;
663 }
664 $this->debug("serialize_val returning $xml");
665 return $xml;
666 }

References appendDebug(), debug(), expandEntities(), isArraySimpleOrStruct(), serialize_val(), and varDump().

+ Here is the call graph for this function:

◆ serializeEnvelope() [1/2]

nusoap_base::serializeEnvelope (   $body,
  $headers = false,
  $namespaces = array(),
  $style = 'rpc',
  $use = 'encoded' 
)

serialize message

Parameters
stringbody
stringheaders optional
arraynamespaces optional
stringstyle optional (rpc|document)
stringuse optional (encoded|literal)
Returns
string message @access public

Definition at line 417 of file nusoap.php.

417 {
418 // TODO: add an option to automatically run utf8_encode on $body and $headers
419 // if $this->soap_defencoding is UTF-8. Not doing this automatically allows
420 // one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1
421
422 // serialize namespaces
423 $ns_string = '';
424 foreach(array_merge($this->namespaces,$namespaces) as $k => $v){
425 $ns_string .= " xmlns:$k=\"$v\"";
426 }
427 if($style == 'rpc' && $use == 'encoded') {
428 $ns_string = ' SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"' . $ns_string;
429 }
430
431 // serialize headers
432 if($headers){
433 $headers = "<SOAP-ENV:Header>".$headers."</SOAP-ENV:Header>";
434 }
435 // serialize envelope
436 return
437 '<?xml version="1.0" encoding="'.$this->soap_defencoding .'"?'.">".
438 '<SOAP-ENV:Envelope'.$ns_string.">".
439 $headers.
440 "<SOAP-ENV:Body>".
441 $body.
442 "</SOAP-ENV:Body>".
443 "</SOAP-ENV:Envelope>";
444 }
$style
Definition: example_012.php:70

References $namespaces, and $style.

Referenced by soap_client\call(), nusoap_client\call(), soap_server\serialize_return(), and nusoap_server\serialize_return().

+ Here is the caller graph for this function:

◆ serializeEnvelope() [2/2]

nusoap_base::serializeEnvelope (   $body,
  $headers = false,
  $namespaces = array(),
  $style = 'rpc',
  $use = 'encoded',
  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/' 
)

serializes a message

Parameters
string$bodythe XML of the SOAP body
mixed$headersoptional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array
array$namespacesoptional the namespaces used in generating the body and headers
string$styleoptional (rpc|document)
string$useoptional (encoded|literal)
string$encodingStyleoptional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
Returns
string the message @access public

Definition at line 680 of file nusoap.php.

680 ://schemas.xmlsoap.org/soap/encoding/'){
681 // TODO: add an option to automatically run utf8_encode on $body and $headers
682 // if $this->soap_defencoding is UTF-8. Not doing this automatically allows
683 // one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1
684
685 $this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle");
686 $this->debug("headers:");
687 $this->appendDebug($this->varDump($headers));
688 $this->debug("namespaces:");
689 $this->appendDebug($this->varDump($namespaces));
690
691 // serialize namespaces
692 $ns_string = '';
693 foreach(array_merge($this->namespaces,$namespaces) as $k => $v){
694 $ns_string .= " xmlns:$k=\"$v\"";
695 }
696 if($encodingStyle) {
697 $ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string";
698 }
699
700 // serialize headers
701 if($headers){
702 if (is_array($headers)) {
703 $xml = '';
704 foreach ($headers as $k => $v) {
705 if (is_object($v) && get_class($v) == 'soapval') {
706 $xml .= $this->serialize_val($v, false, false, false, false, false, $use);
707 } else {
708 $xml .= $this->serialize_val($v, $k, false, false, false, false, $use);
709 }
710 }
711 $headers = $xml;
712 $this->debug("In serializeEnvelope, serialized array of headers to $headers");
713 }
714 $headers = "<SOAP-ENV:Header>".$headers."</SOAP-ENV:Header>";
715 }
716 // serialize envelope
717 return
718 '<?xml version="1.0" encoding="'.$this->soap_defencoding .'"?'.">".
719 '<SOAP-ENV:Envelope'.$ns_string.">".
720 $headers.
721 "<SOAP-ENV:Body>".
722 $body.
723 "</SOAP-ENV:Body>".
724 "</SOAP-ENV:Envelope>";
725 }

References $namespaces, appendDebug(), debug(), serialize_val(), and varDump().

+ Here is the call graph for this function:

◆ setDebugLevel()

nusoap_base::setDebugLevel (   $level)

sets the debug level for this instance

Parameters
int$levelDebug level 0-9, where 0 turns off @access public

Definition at line 272 of file nusoap.php.

272 {
273 $this->debugLevel = $level;
274 }

◆ setError() [1/2]

◆ setError() [2/2]

nusoap_base::setError (   $str)

sets error string

Returns
boolean $string error string @access private

Definition at line 378 of file nusoap.php.

378 {
379 $this->error_str = $str;
380 }

◆ setGlobalDebugLevel()

nusoap_base::setGlobalDebugLevel (   $level)

sets the global debug level, which applies to future instances

Parameters
int$levelDebug level 0-9, where 0 turns off @access public

Definition at line 252 of file nusoap.php.

252 {
253 $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = $level;
254 }

References $GLOBALS.

◆ varDump() [1/2]

◆ varDump() [2/2]

nusoap_base::varDump (   $data)

Returns a string with the output of var_dump.

Parameters
mixed$dataThe variable to var_dump
Returns
string The output of var_dump @access public

Definition at line 880 of file nusoap.php.

880 {
881 ob_start();
882 var_dump($data);
883 $ret_val = ob_get_contents();
884 ob_end_clean();
885 return $ret_val;
886 }

References $data.

Field Documentation

◆ $charencoding

nusoap_base::$charencoding = true

Definition at line 70 of file nusoap.php.

◆ $debug_str

nusoap_base::$debug_str = ''

Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment)

@var string
@access private

Definition at line 67 of file nusoap.php.

Referenced by getDebug().

◆ $debugLevel

nusoap_base::$debugLevel

Definition at line 142 of file nusoap.php.

Referenced by getDebugLevel().

◆ $error_str

nusoap_base::$error_str = false

Current error string (manipulated by getError/setError)

@var string
@access private

Definition at line 66 of file nusoap.php.

Referenced by soap_transport_http\connect(), and getError().

◆ $namespaces

nusoap_base::$namespaces
Initial value:
= array(
'SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/',
'xsd' => 'http://www.w3.org/2001/XMLSchema',
'xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/',
'si' => 'http://soapinterop.org/xsd')

Definition at line 95 of file nusoap.php.

Referenced by nusoap_xmlschema\__construct(), serializeEnvelope(), and XMLSchema\XMLSchema().

◆ $revision

nusoap_base::$revision = '$Revision$'

Definition at line 65 of file nusoap.php.

◆ $soap_defencoding

◆ $title

nusoap_base::$title = 'NuSOAP'

Definition at line 63 of file nusoap.php.

◆ $typemap

nusoap_base::$typemap
Initial value:
= array(
'http://www.w3.org/2001/XMLSchema' => array(
'string'=>'string','boolean'=>'boolean','float'=>'double','double'=>'double','decimal'=>'double',
'duration'=>'','dateTime'=>'string','time'=>'string','date'=>'string','gYearMonth'=>'',
'gYear'=>'','gMonthDay'=>'','gDay'=>'','gMonth'=>'','hexBinary'=>'string','base64Binary'=>'string',
'normalizedString'=>'string','token'=>'string','language'=>'','NMTOKEN'=>'','NMTOKENS'=>'','Name'=>'','NCName'=>'','ID'=>'',
'IDREF'=>'','IDREFS'=>'','ENTITY'=>'','ENTITIES'=>'','integer'=>'integer','nonPositiveInteger'=>'integer',
'negativeInteger'=>'integer','long'=>'integer','int'=>'integer','short'=>'integer','byte'=>'integer','nonNegativeInteger'=>'integer',
'unsignedLong'=>'','unsignedInt'=>'','unsignedShort'=>'','unsignedByte'=>'','positiveInteger'=>''),
'http://www.w3.org/1999/XMLSchema' => array(
'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double',
'float'=>'double','dateTime'=>'string',
'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'),
'http://soapinterop.org/xsd' => array('SOAPStruct'=>'struct'),
'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string','array'=>'array','Array'=>'array'),
'http://xml.apache.org/xml-soap' => array('Map')
)

Definition at line 110 of file nusoap.php.

◆ $usedNamespaces

nusoap_base::$usedNamespaces = array()

Definition at line 101 of file nusoap.php.

Referenced by soap_client\call(), and nusoap_client\call().

◆ $version

nusoap_base::$version = '0.6.7'

Definition at line 64 of file nusoap.php.

◆ $xmlEntities

nusoap_base::$xmlEntities
Initial value:
= array('quot' => '"','amp' => '&',
'lt' => '<','gt' => '>','apos' => "'")

Definition at line 135 of file nusoap.php.

◆ $XMLSchemaVersion

nusoap_base::$XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'

Definition at line 78 of file nusoap.php.

Referenced by soap_parser\start_element(), and nusoap_parser\start_element().


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