nusoap_base Klassenreferenz

Klassendiagramm für nusoap_base:

Inheritance graph
[Legende]

Aufstellung aller Elemente

Öffentliche Methoden

 nusoap_base ()
 getGlobalDebugLevel ()
 setGlobalDebugLevel ($level)
 getDebugLevel ()
 setDebugLevel ($level)
 debug ($string)
 appendDebug ($string)
 clearDebug ()
getDebug ()
getDebugAsXMLComment ()
 expandEntities ($val)
 getError ()
 setError ($str)
 isArraySimpleOrStruct ($val)
 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/')
 formatDump ($str)
 contractQname ($qname)
 expandQname ($qname)
 getLocalPart ($str)
 getPrefix ($str)
 getNamespaceFromPrefix ($prefix)
 getPrefixFromNamespace ($ns)
 getmicrotime ()
 varDump ($data)
 __toString ()
 nusoap_base ()
 getGlobalDebugLevel ()
 setGlobalDebugLevel ($level)
 getDebugLevel ()
 setDebugLevel ($level)
 debug ($string)
 appendDebug ($string)
 clearDebug ()
getDebug ()
getDebugAsXMLComment ()
 expandEntities ($val)
 getError ()
 setError ($str)
 isArraySimpleOrStruct ($val)
 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/')
 formatDump ($str)
 contractQname ($qname)
 expandQname ($qname)
 getLocalPart ($str)
 getPrefix ($str)
 getNamespaceFromPrefix ($prefix)
 getPrefixFromNamespace ($ns)
 getmicrotime ()
 varDump ($data)
 __toString ()

Öffentliche Attribute

 $title = 'NuSOAP'
 $version = '1.0rc1'
 $revision = '$Revision: 1.55 $'
 $error_str = ''
 $debug_str = ''
 $charencoding = true
 $debugLevel
 $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'
 $soap_defencoding = 'ISO-8859-1'
 $namespaces
 $usedNamespaces = array()
 $typemap
 $xmlEntities


Ausführliche Beschreibung

nusoap_base

Autor:
Dietrich Ayala <dietrich@ganx4.com>

Scott Nichol <snichol@users.sourceforge.net>

Version:
Id
class.nusoap_base.php,v 1.55 2008/03/14 20:52:07 snichol Exp
public

nusoap_base

Autor:
Dietrich Ayala <dietrich@ganx4.com>

Scott Nichol <snichol@users.sourceforge.net>

Version:
Id
nusoap.php,v 1.121 2008/03/14 20:52:11 snichol Exp
public

Definiert in Zeile 85 der Datei class.nusoap_base.php.


Dokumentation der Elementfunktionen

nusoap_base::__toString (  ) 

represents the object as a string

Rückgabe:
string public

Definiert in Zeile 887 der Datei nusoap.php.

00887                               {
00888                 return $this->varDump($this);
00889         }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

nusoap_base::__toString (  ) 

represents the object as a string

Rückgabe:
string public

Definiert in Zeile 887 der Datei class.nusoap_base.php.

00887                               {
00888                 return $this->varDump($this);
00889         }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

nusoap_base::appendDebug ( string  ) 

adds debug data to the instance debug string without formatting

Parameter:
string $string debug data public

Definiert in Zeile 287 der Datei nusoap.php.

00287                                      {
00288                 if ($this->debugLevel > 0) {
00289                         // it would be nice to use a memory stream here to use
00290                         // memory more efficiently
00291                         $this->debug_str .= $string;
00292                 }
00293         }

nusoap_base::appendDebug ( string  ) 

adds debug data to the instance debug string without formatting

Parameter:
string $string debug data public

Definiert in Zeile 287 der Datei class.nusoap_base.php.

00287                                      {
00288                 if ($this->debugLevel > 0) {
00289                         // it would be nice to use a memory stream here to use
00290                         // memory more efficiently
00291                         $this->debug_str .= $string;
00292                 }
00293         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::clearDebug (  ) 

clears the current debug data for this instance

public

Definiert in Zeile 300 der Datei nusoap.php.

00300                               {
00301                 // it would be nice to use a memory stream here to use
00302                 // memory more efficiently
00303                 $this->debug_str = '';
00304         }

nusoap_base::clearDebug (  ) 

clears the current debug data for this instance

public

Definiert in Zeile 300 der Datei class.nusoap_base.php.

00300                               {
00301                 // it would be nice to use a memory stream here to use
00302                 // memory more efficiently
00303                 $this->debug_str = '';
00304         }

nusoap_base::contractQname ( qname  ) 

contracts (changes namespace to prefix) a qualified name

Parameter:
string $qname qname
Rückgabe:
string contracted qname private

Definiert in Zeile 740 der Datei nusoap.php.

00740                                       {
00741                 // get element namespace
00742                 //$this->xdebug("Contract $qname");
00743                 if (strrpos($qname, ':')) {
00744                         // get unqualified name
00745                         $name = substr($qname, strrpos($qname, ':') + 1);
00746                         // get ns
00747                         $ns = substr($qname, 0, strrpos($qname, ':'));
00748                         $p = $this->getPrefixFromNamespace($ns);
00749                         if ($p) {
00750                                 return $p . ':' . $name;
00751                         }
00752                         return $qname;
00753                 } else {
00754                         return $qname;
00755                 }
00756         }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

nusoap_base::contractQname ( qname  ) 

contracts (changes namespace to prefix) a qualified name

Parameter:
string $qname qname
Rückgabe:
string contracted qname private

Definiert in Zeile 740 der Datei class.nusoap_base.php.

00740                                       {
00741                 // get element namespace
00742                 //$this->xdebug("Contract $qname");
00743                 if (strrpos($qname, ':')) {
00744                         // get unqualified name
00745                         $name = substr($qname, strrpos($qname, ':') + 1);
00746                         // get ns
00747                         $ns = substr($qname, 0, strrpos($qname, ':'));
00748                         $p = $this->getPrefixFromNamespace($ns);
00749                         if ($p) {
00750                                 return $p . ':' . $name;
00751                         }
00752                         return $qname;
00753                 } else {
00754                         return $qname;
00755                 }
00756         }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

nusoap_base::debug ( string  ) 

adds debug data to the instance debug string with formatting

Parameter:
string $string debug data private

Definiert in Zeile 275 der Datei nusoap.php.

00275                                {
00276                 if ($this->debugLevel > 0) {
00277                         $this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n");
00278                 }
00279         }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

nusoap_base::debug ( string  ) 

adds debug data to the instance debug string with formatting

Parameter:
string $string debug data private

Definiert in Zeile 275 der Datei class.nusoap_base.php.

00275                                {
00276                 if ($this->debugLevel > 0) {
00277                         $this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n");
00278                 }
00279         }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

nusoap_base::expandEntities ( val  ) 

expands entities, e.g. changes '<' to '<'.

Parameter:
string $val The string in which to expand entities. private

Definiert in Zeile 341 der Datei nusoap.php.

00341                                       {
00342                 if ($this->charencoding) {
00343                 $val = str_replace('&', '&amp;', $val);
00344                 $val = str_replace("'", '&apos;', $val);
00345                 $val = str_replace('"', '&quot;', $val);
00346                 $val = str_replace('<', '&lt;', $val);
00347                 $val = str_replace('>', '&gt;', $val);
00348             }
00349             return $val;
00350         }

nusoap_base::expandEntities ( val  ) 

expands entities, e.g. changes '<' to '<'.

Parameter:
string $val The string in which to expand entities. private

Definiert in Zeile 341 der Datei class.nusoap_base.php.

00341                                       {
00342                 if ($this->charencoding) {
00343                 $val = str_replace('&', '&amp;', $val);
00344                 $val = str_replace("'", '&apos;', $val);
00345                 $val = str_replace('"', '&quot;', $val);
00346                 $val = str_replace('<', '&lt;', $val);
00347                 $val = str_replace('>', '&gt;', $val);
00348             }
00349             return $val;
00350         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::expandQname ( qname  ) 

expands (changes prefix to namespace) a qualified name

Parameter:
string $qname qname
Rückgabe:
string expanded qname private

Definiert in Zeile 765 der Datei nusoap.php.

00765                                     {
00766                 // get element prefix
00767                 if(strpos($qname,':') && !ereg('^http://',$qname)){
00768                         // get unqualified name
00769                         $name = substr(strstr($qname,':'),1);
00770                         // get ns prefix
00771                         $prefix = substr($qname,0,strpos($qname,':'));
00772                         if(isset($this->namespaces[$prefix])){
00773                                 return $this->namespaces[$prefix].':'.$name;
00774                         } else {
00775                                 return $qname;
00776                         }
00777                 } else {
00778                         return $qname;
00779                 }
00780         }

nusoap_base::expandQname ( qname  ) 

expands (changes prefix to namespace) a qualified name

Parameter:
string $qname qname
Rückgabe:
string expanded qname private

Definiert in Zeile 765 der Datei class.nusoap_base.php.

00765                                     {
00766                 // get element prefix
00767                 if(strpos($qname,':') && !ereg('^http://',$qname)){
00768                         // get unqualified name
00769                         $name = substr(strstr($qname,':'),1);
00770                         // get ns prefix
00771                         $prefix = substr($qname,0,strpos($qname,':'));
00772                         if(isset($this->namespaces[$prefix])){
00773                                 return $this->namespaces[$prefix].':'.$name;
00774                         } else {
00775                                 return $qname;
00776                         }
00777                 } else {
00778                         return $qname;
00779                 }
00780         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::formatDump ( str  ) 

formats a string to be inserted into an HTML stream

Parameter:
string $str The string to format
Rückgabe:
string The formatted string public
Veraltet:

Definiert in Zeile 728 der Datei nusoap.php.

00728                              {
00729                 $str = htmlspecialchars($str);
00730                 return nl2br($str);
00731     }

nusoap_base::formatDump ( str  ) 

formats a string to be inserted into an HTML stream

Parameter:
string $str The string to format
Rückgabe:
string The formatted string public
Veraltet:

Definiert in Zeile 728 der Datei class.nusoap_base.php.

00728                              {
00729                 $str = htmlspecialchars($str);
00730                 return nl2br($str);
00731     }

& nusoap_base::getDebug (  ) 

gets the current debug data for this instance

Rückgabe:
debug data public

Definiert in Zeile 312 der Datei nusoap.php.

00312                              {
00313                 // it would be nice to use a memory stream here to use
00314                 // memory more efficiently
00315                 return $this->debug_str;
00316         }

& nusoap_base::getDebug (  ) 

gets the current debug data for this instance

Rückgabe:
debug data public

Definiert in Zeile 312 der Datei class.nusoap_base.php.

00312                              {
00313                 // it would be nice to use a memory stream here to use
00314                 // memory more efficiently
00315                 return $this->debug_str;
00316         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

& nusoap_base::getDebugAsXMLComment (  ) 

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

Rückgabe:
debug data as an XML comment public

Definiert in Zeile 325 der Datei nusoap.php.

00325                                          {
00326                 // it would be nice to use a memory stream here to use
00327                 // memory more efficiently
00328                 while (strpos($this->debug_str, '--')) {
00329                         $this->debug_str = str_replace('--', '- -', $this->debug_str);
00330                 }
00331                 $ret = "<!--\n" . $this->debug_str . "\n-->";
00332         return $ret;
00333         }

& nusoap_base::getDebugAsXMLComment (  ) 

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

Rückgabe:
debug data as an XML comment public

Definiert in Zeile 325 der Datei class.nusoap_base.php.

00325                                          {
00326                 // it would be nice to use a memory stream here to use
00327                 // memory more efficiently
00328                 while (strpos($this->debug_str, '--')) {
00329                         $this->debug_str = str_replace('--', '- -', $this->debug_str);
00330                 }
00331                 $ret = "<!--\n" . $this->debug_str . "\n-->";
00332         return $ret;
00333         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::getDebugLevel (  ) 

gets the debug level for this instance

Rückgabe:
int Debug level 0-9, where 0 turns off public

Definiert in Zeile 255 der Datei nusoap.php.

00255                                  {
00256                 return $this->debugLevel;
00257         }

nusoap_base::getDebugLevel (  ) 

gets the debug level for this instance

Rückgabe:
int Debug level 0-9, where 0 turns off public

Definiert in Zeile 255 der Datei class.nusoap_base.php.

00255                                  {
00256                 return $this->debugLevel;
00257         }

nusoap_base::getError (  ) 

returns error string if present

Rückgabe:
mixed error string or false public

Definiert in Zeile 358 der Datei nusoap.php.

00358                            {
00359                 if($this->error_str != ''){
00360                         return $this->error_str;
00361                 }
00362                 return false;
00363         }

nusoap_base::getError (  ) 

returns error string if present

Rückgabe:
mixed error string or false public

Definiert in Zeile 358 der Datei class.nusoap_base.php.

00358                            {
00359                 if($this->error_str != ''){
00360                         return $this->error_str;
00361                 }
00362                 return false;
00363         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::getGlobalDebugLevel (  ) 

gets the global debug level, which applies to future instances

Rückgabe:
integer Debug level 0-9, where 0 turns off public

Definiert in Zeile 235 der Datei nusoap.php.

00235                                        {
00236                 return $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'];
00237         }

nusoap_base::getGlobalDebugLevel (  ) 

gets the global debug level, which applies to future instances

Rückgabe:
integer Debug level 0-9, where 0 turns off public

Definiert in Zeile 235 der Datei class.nusoap_base.php.

00235                                        {
00236                 return $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'];
00237         }

nusoap_base::getLocalPart ( str  ) 

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

Parameter:
string $str The prefixed string
Rückgabe:
string The local part public

Definiert in Zeile 790 der Datei nusoap.php.

00790                                    {
00791                 if($sstr = strrchr($str,':')){
00792                         // get unqualified name
00793                         return substr( $sstr, 1 );
00794                 } else {
00795                         return $str;
00796                 }
00797         }

nusoap_base::getLocalPart ( str  ) 

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

Parameter:
string $str The prefixed string
Rückgabe:
string The local part public

Definiert in Zeile 790 der Datei class.nusoap_base.php.

00790                                    {
00791                 if($sstr = strrchr($str,':')){
00792                         // get unqualified name
00793                         return substr( $sstr, 1 );
00794                 } else {
00795                         return $str;
00796                 }
00797         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::getmicrotime (  ) 

returns the time in ODBC canonical form with microseconds

Rückgabe:
string The time in ODBC canonical form with microseconds public

Definiert in Zeile 854 der Datei nusoap.php.

00854                                 {
00855                 if (function_exists('gettimeofday')) {
00856                         $tod = gettimeofday();
00857                         $sec = $tod['sec'];
00858                         $usec = $tod['usec'];
00859                 } else {
00860                         $sec = time();
00861                         $usec = 0;
00862                 }
00863                 return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec);
00864         }

nusoap_base::getmicrotime (  ) 

returns the time in ODBC canonical form with microseconds

Rückgabe:
string The time in ODBC canonical form with microseconds public

Definiert in Zeile 854 der Datei class.nusoap_base.php.

00854                                 {
00855                 if (function_exists('gettimeofday')) {
00856                         $tod = gettimeofday();
00857                         $sec = $tod['sec'];
00858                         $usec = $tod['usec'];
00859                 } else {
00860                         $sec = time();
00861                         $usec = 0;
00862                 }
00863                 return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec);
00864         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::getNamespaceFromPrefix ( prefix  ) 

pass it a prefix, it returns a namespace

Parameter:
string $prefix The prefix
Rückgabe:
mixed The namespace, false if no namespace has the specified prefix public

Definiert in Zeile 822 der Datei nusoap.php.

00822                                                 {
00823                 if (isset($this->namespaces[$prefix])) {
00824                         return $this->namespaces[$prefix];
00825                 }
00826                 //$this->setError("No namespace registered for prefix '$prefix'");
00827                 return false;
00828         }

nusoap_base::getNamespaceFromPrefix ( prefix  ) 

pass it a prefix, it returns a namespace

Parameter:
string $prefix The prefix
Rückgabe:
mixed The namespace, false if no namespace has the specified prefix public

Definiert in Zeile 822 der Datei class.nusoap_base.php.

00822                                                 {
00823                 if (isset($this->namespaces[$prefix])) {
00824                         return $this->namespaces[$prefix];
00825                 }
00826                 //$this->setError("No namespace registered for prefix '$prefix'");
00827                 return false;
00828         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::getPrefix ( str  ) 

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

Parameter:
string $str The prefixed string
Rückgabe:
mixed The prefix or false if there is no prefix public

Definiert in Zeile 807 der Datei nusoap.php.

00807                                 {
00808                 if($pos = strrpos($str,':')){
00809                         // get prefix
00810                         return substr($str,0,$pos);
00811                 }
00812                 return false;
00813         }

nusoap_base::getPrefix ( str  ) 

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

Parameter:
string $str The prefixed string
Rückgabe:
mixed The prefix or false if there is no prefix public

Definiert in Zeile 807 der Datei class.nusoap_base.php.

00807                                 {
00808                 if($pos = strrpos($str,':')){
00809                         // get prefix
00810                         return substr($str,0,$pos);
00811                 }
00812                 return false;
00813         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::getPrefixFromNamespace ( ns  ) 

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

Parameter:
string $ns The namespace
Rückgabe:
mixed The prefix, false if the namespace has no prefixes public

Definiert in Zeile 838 der Datei nusoap.php.

00838                                              {
00839                 foreach ($this->namespaces as $p => $n) {
00840                         if ($ns == $n || $ns == $p) {
00841                             $this->usedNamespaces[$p] = $n;
00842                                 return $p;
00843                         }
00844                 }
00845                 return false;
00846         }

nusoap_base::getPrefixFromNamespace ( ns  ) 

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

Parameter:
string $ns The namespace
Rückgabe:
mixed The prefix, false if the namespace has no prefixes public

Definiert in Zeile 838 der Datei class.nusoap_base.php.

00838                                              {
00839                 foreach ($this->namespaces as $p => $n) {
00840                         if ($ns == $n || $ns == $p) {
00841                             $this->usedNamespaces[$p] = $n;
00842                                 return $p;
00843                         }
00844                 }
00845                 return false;
00846         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::isArraySimpleOrStruct ( val  ) 

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

Parameter:
mixed $val The PHP array
Rückgabe:
string (arraySimple|arrayStruct) private

Definiert in Zeile 382 der Datei nusoap.php.

00382                                              {
00383         $keyList = array_keys($val);
00384                 foreach ($keyList as $keyListValue) {
00385                         if (!is_int($keyListValue)) {
00386                                 return 'arrayStruct';
00387                         }
00388                 }
00389                 return 'arraySimple';
00390         }

nusoap_base::isArraySimpleOrStruct ( val  ) 

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

Parameter:
mixed $val The PHP array
Rückgabe:
string (arraySimple|arrayStruct) private

Definiert in Zeile 382 der Datei class.nusoap_base.php.

00382                                              {
00383         $keyList = array_keys($val);
00384                 foreach ($keyList as $keyListValue) {
00385                         if (!is_int($keyListValue)) {
00386                                 return 'arrayStruct';
00387                         }
00388                 }
00389                 return 'arraySimple';
00390         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::nusoap_base (  ) 

constructor

public

Definiert in Zeile 225 der Datei nusoap.php.

00225                                {
00226                 $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'];
00227         }

nusoap_base::nusoap_base (  ) 

constructor

public

Definiert in Zeile 225 der Datei class.nusoap_base.php.

00225                                {
00226                 $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'];
00227         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

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'.

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

Definiert in Zeile 407 der Datei nusoap.php.

00407                                                                                                                                            {
00408                 $this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use, soapval=$soapval");
00409                 $this->appendDebug('value=' . $this->varDump($val));
00410                 $this->appendDebug('attributes=' . $this->varDump($attributes));
00411                 
00412         if (is_object($val) && get_class($val) == 'soapval' && (! $soapval)) {
00413                 $this->debug("serialize_val: serialize soapval");
00414                 $xml = $val->serialize($use);
00415                         $this->appendDebug($val->getDebug());
00416                         $val->clearDebug();
00417                         $this->debug("serialize_val of soapval returning $xml");
00418                         return $xml;
00419         }
00420                 // force valid name if necessary
00421                 if (is_numeric($name)) {
00422                         $name = '__numeric_' . $name;
00423                 } elseif (! $name) {
00424                         $name = 'noname';
00425                 }
00426                 // if name has ns, add ns prefix to name
00427                 $xmlns = '';
00428         if($name_ns){
00429                         $prefix = 'nu'.rand(1000,9999);
00430                         $name = $prefix.':'.$name;
00431                         $xmlns .= " xmlns:$prefix=\"$name_ns\"";
00432                 }
00433                 // if type is prefixed, create type prefix
00434                 if($type_ns != '' && $type_ns == $this->namespaces['xsd']){
00435                         // need to fix this. shouldn't default to xsd if no ns specified
00436                     // w/o checking against typemap
00437                         $type_prefix = 'xsd';
00438                 } elseif($type_ns){
00439                         $type_prefix = 'ns'.rand(1000,9999);
00440                         $xmlns .= " xmlns:$type_prefix=\"$type_ns\"";
00441                 }
00442                 // serialize attributes if present
00443                 $atts = '';
00444                 if($attributes){
00445                         foreach($attributes as $k => $v){
00446                                 $atts .= " $k=\"".$this->expandEntities($v).'"';
00447                         }
00448                 }
00449                 // serialize null value
00450                 if (is_null($val)) {
00451                 $this->debug("serialize_val: serialize null");
00452                         if ($use == 'literal') {
00453                                 // TODO: depends on minOccurs
00454                                 $xml = "<$name$xmlns$atts/>";
00455                                 $this->debug("serialize_val returning $xml");
00456                         return $xml;
00457                 } else {
00458                                 if (isset($type) && isset($type_prefix)) {
00459                                         $type_str = " xsi:type=\"$type_prefix:$type\"";
00460                                 } else {
00461                                         $type_str = '';
00462                                 }
00463                                 $xml = "<$name$xmlns$type_str$atts xsi:nil=\"true\"/>";
00464                                 $this->debug("serialize_val returning $xml");
00465                         return $xml;
00466                 }
00467                 }
00468         // serialize if an xsd built-in primitive type
00469         if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){
00470                 $this->debug("serialize_val: serialize xsd built-in primitive type");
00471                 if (is_bool($val)) {
00472                         if ($type == 'boolean') {
00473                                 $val = $val ? 'true' : 'false';
00474                         } elseif (! $val) {
00475                                 $val = 0;
00476                         }
00477                         } else if (is_string($val)) {
00478                                 $val = $this->expandEntities($val);
00479                         }
00480                         if ($use == 'literal') {
00481                                 $xml = "<$name$xmlns$atts>$val</$name>";
00482                                 $this->debug("serialize_val returning $xml");
00483                         return $xml;
00484                 } else {
00485                                 $xml = "<$name$xmlns xsi:type=\"xsd:$type\"$atts>$val</$name>";
00486                                 $this->debug("serialize_val returning $xml");
00487                         return $xml;
00488                 }
00489         }
00490                 // detect type and serialize
00491                 $xml = '';
00492                 switch(true) {
00493                         case (is_bool($val) || $type == 'boolean'):
00494                                 $this->debug("serialize_val: serialize boolean");
00495                         if ($type == 'boolean') {
00496                                 $val = $val ? 'true' : 'false';
00497                         } elseif (! $val) {
00498                                 $val = 0;
00499                         }
00500                                 if ($use == 'literal') {
00501                                         $xml .= "<$name$xmlns$atts>$val</$name>";
00502                                 } else {
00503                                         $xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val</$name>";
00504                                 }
00505                                 break;
00506                         case (is_int($val) || is_long($val) || $type == 'int'):
00507                                 $this->debug("serialize_val: serialize int");
00508                                 if ($use == 'literal') {
00509                                         $xml .= "<$name$xmlns$atts>$val</$name>";
00510                                 } else {
00511                                         $xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val</$name>";
00512                                 }
00513                                 break;
00514                         case (is_float($val)|| is_double($val) || $type == 'float'):
00515                                 $this->debug("serialize_val: serialize float");
00516                                 if ($use == 'literal') {
00517                                         $xml .= "<$name$xmlns$atts>$val</$name>";
00518                                 } else {
00519                                         $xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val</$name>";
00520                                 }
00521                                 break;
00522                         case (is_string($val) || $type == 'string'):
00523                                 $this->debug("serialize_val: serialize string");
00524                                 $val = $this->expandEntities($val);
00525                                 if ($use == 'literal') {
00526                                         $xml .= "<$name$xmlns$atts>$val</$name>";
00527                                 } else {
00528                                         $xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val</$name>";
00529                                 }
00530                                 break;
00531                         case is_object($val):
00532                                 $this->debug("serialize_val: serialize object");
00533                         if (get_class($val) == 'soapval') {
00534                                 $this->debug("serialize_val: serialize soapval object");
00535                                 $pXml = $val->serialize($use);
00536                                         $this->appendDebug($val->getDebug());
00537                                         $val->clearDebug();
00538                         } else {
00539                                         if (! $name) {
00540                                                 $name = get_class($val);
00541                                                 $this->debug("In serialize_val, used class name $name as element name");
00542                                         } else {
00543                                                 $this->debug("In serialize_val, do not override name $name for element name for class " . get_class($val));
00544                                         }
00545                                         foreach(get_object_vars($val) as $k => $v){
00546                                                 $pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use);
00547                                         }
00548                                 }
00549                                 if(isset($type) && isset($type_prefix)){
00550                                         $type_str = " xsi:type=\"$type_prefix:$type\"";
00551                                 } else {
00552                                         $type_str = '';
00553                                 }
00554                                 if ($use == 'literal') {
00555                                         $xml .= "<$name$xmlns$atts>$pXml</$name>";
00556                                 } else {
00557                                         $xml .= "<$name$xmlns$type_str$atts>$pXml</$name>";
00558                                 }
00559                                 break;
00560                         break;
00561                         case (is_array($val) || $type):
00562                                 // detect if struct or array
00563                                 $valueType = $this->isArraySimpleOrStruct($val);
00564                 if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
00565                                         $this->debug("serialize_val: serialize array");
00566                                         $i = 0;
00567                                         if(is_array($val) && count($val)> 0){
00568                                                 foreach($val as $v){
00569                                 if(is_object($v) && get_class($v) ==  'soapval'){
00570                                                                 $tt_ns = $v->type_ns;
00571                                                                 $tt = $v->type;
00572                                                         } elseif (is_array($v)) {
00573                                                                 $tt = $this->isArraySimpleOrStruct($v);
00574                                                         } else {
00575                                                                 $tt = gettype($v);
00576                                 }
00577                                                         $array_types[$tt] = 1;
00578                                                         // TODO: for literal, the name should be $name
00579                                                         $xml .= $this->serialize_val($v,'item',false,false,false,false,$use);
00580                                                         ++$i;
00581                                                 }
00582                                                 if(count($array_types) > 1){
00583                                                         $array_typename = 'xsd:anyType';
00584                                                 } elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) {
00585                                                         if ($tt == 'integer') {
00586                                                                 $tt = 'int';
00587                                                         }
00588                                                         $array_typename = 'xsd:'.$tt;
00589                                                 } elseif(isset($tt) && $tt == 'arraySimple'){
00590                                                         $array_typename = 'SOAP-ENC:Array';
00591                                                 } elseif(isset($tt) && $tt == 'arrayStruct'){
00592                                                         $array_typename = 'unnamed_struct_use_soapval';
00593                                                 } else {
00594                                                         // if type is prefixed, create type prefix
00595                                                         if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){
00596                                                                  $array_typename = 'xsd:' . $tt;
00597                                                         } elseif ($tt_ns) {
00598                                                                 $tt_prefix = 'ns' . rand(1000, 9999);
00599                                                                 $array_typename = "$tt_prefix:$tt";
00600                                                                 $xmlns .= " xmlns:$tt_prefix=\"$tt_ns\"";
00601                                                         } else {
00602                                                                 $array_typename = $tt;
00603                                                         }
00604                                                 }
00605                                                 $array_type = $i;
00606                                                 if ($use == 'literal') {
00607                                                         $type_str = '';
00608                                                 } else if (isset($type) && isset($type_prefix)) {
00609                                                         $type_str = " xsi:type=\"$type_prefix:$type\"";
00610                                                 } else {
00611                                                         $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\"";
00612                                                 }
00613                                         // empty array
00614                                         } else {
00615                                                 if ($use == 'literal') {
00616                                                         $type_str = '';
00617                                                 } else if (isset($type) && isset($type_prefix)) {
00618                                                         $type_str = " xsi:type=\"$type_prefix:$type\"";
00619                                                 } else {
00620                                                         $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\"";
00621                                                 }
00622                                         }
00623                                         // TODO: for array in literal, there is no wrapper here
00624                                         $xml = "<$name$xmlns$type_str$atts>".$xml."</$name>";
00625                                 } else {
00626                                         // got a struct
00627                                         $this->debug("serialize_val: serialize struct");
00628                                         if(isset($type) && isset($type_prefix)){
00629                                                 $type_str = " xsi:type=\"$type_prefix:$type\"";
00630                                         } else {
00631                                                 $type_str = '';
00632                                         }
00633                                         if ($use == 'literal') {
00634                                                 $xml .= "<$name$xmlns$atts>";
00635                                         } else {
00636                                                 $xml .= "<$name$xmlns$type_str$atts>";
00637                                         }
00638                                         foreach($val as $k => $v){
00639                                                 // Apache Map
00640                                                 if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') {
00641                                                         $xml .= '<item>';
00642                                                         $xml .= $this->serialize_val($k,'key',false,false,false,false,$use);
00643                                                         $xml .= $this->serialize_val($v,'value',false,false,false,false,$use);
00644                                                         $xml .= '</item>';
00645                                                 } else {
00646                                                         $xml .= $this->serialize_val($v,$k,false,false,false,false,$use);
00647                                                 }
00648                                         }
00649                                         $xml .= "</$name>";
00650                                 }
00651                                 break;
00652                         default:
00653                                 $this->debug("serialize_val: serialize unknown");
00654                                 $xml .= 'not detected, got '.gettype($val).' for '.$val;
00655                                 break;
00656                 }
00657                 $this->debug("serialize_val returning $xml");
00658                 return $xml;
00659         }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

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'.

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

Definiert in Zeile 407 der Datei class.nusoap_base.php.

00407                                                                                                                                            {
00408                 $this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use, soapval=$soapval");
00409                 $this->appendDebug('value=' . $this->varDump($val));
00410                 $this->appendDebug('attributes=' . $this->varDump($attributes));
00411                 
00412         if (is_object($val) && get_class($val) == 'soapval' && (! $soapval)) {
00413                 $this->debug("serialize_val: serialize soapval");
00414                 $xml = $val->serialize($use);
00415                         $this->appendDebug($val->getDebug());
00416                         $val->clearDebug();
00417                         $this->debug("serialize_val of soapval returning $xml");
00418                         return $xml;
00419         }
00420                 // force valid name if necessary
00421                 if (is_numeric($name)) {
00422                         $name = '__numeric_' . $name;
00423                 } elseif (! $name) {
00424                         $name = 'noname';
00425                 }
00426                 // if name has ns, add ns prefix to name
00427                 $xmlns = '';
00428         if($name_ns){
00429                         $prefix = 'nu'.rand(1000,9999);
00430                         $name = $prefix.':'.$name;
00431                         $xmlns .= " xmlns:$prefix=\"$name_ns\"";
00432                 }
00433                 // if type is prefixed, create type prefix
00434                 if($type_ns != '' && $type_ns == $this->namespaces['xsd']){
00435                         // need to fix this. shouldn't default to xsd if no ns specified
00436                     // w/o checking against typemap
00437                         $type_prefix = 'xsd';
00438                 } elseif($type_ns){
00439                         $type_prefix = 'ns'.rand(1000,9999);
00440                         $xmlns .= " xmlns:$type_prefix=\"$type_ns\"";
00441                 }
00442                 // serialize attributes if present
00443                 $atts = '';
00444                 if($attributes){
00445                         foreach($attributes as $k => $v){
00446                                 $atts .= " $k=\"".$this->expandEntities($v).'"';
00447                         }
00448                 }
00449                 // serialize null value
00450                 if (is_null($val)) {
00451                 $this->debug("serialize_val: serialize null");
00452                         if ($use == 'literal') {
00453                                 // TODO: depends on minOccurs
00454                                 $xml = "<$name$xmlns$atts/>";
00455                                 $this->debug("serialize_val returning $xml");
00456                         return $xml;
00457                 } else {
00458                                 if (isset($type) && isset($type_prefix)) {
00459                                         $type_str = " xsi:type=\"$type_prefix:$type\"";
00460                                 } else {
00461                                         $type_str = '';
00462                                 }
00463                                 $xml = "<$name$xmlns$type_str$atts xsi:nil=\"true\"/>";
00464                                 $this->debug("serialize_val returning $xml");
00465                         return $xml;
00466                 }
00467                 }
00468         // serialize if an xsd built-in primitive type
00469         if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){
00470                 $this->debug("serialize_val: serialize xsd built-in primitive type");
00471                 if (is_bool($val)) {
00472                         if ($type == 'boolean') {
00473                                 $val = $val ? 'true' : 'false';
00474                         } elseif (! $val) {
00475                                 $val = 0;
00476                         }
00477                         } else if (is_string($val)) {
00478                                 $val = $this->expandEntities($val);
00479                         }
00480                         if ($use == 'literal') {
00481                                 $xml = "<$name$xmlns$atts>$val</$name>";
00482                                 $this->debug("serialize_val returning $xml");
00483                         return $xml;
00484                 } else {
00485                                 $xml = "<$name$xmlns xsi:type=\"xsd:$type\"$atts>$val</$name>";
00486                                 $this->debug("serialize_val returning $xml");
00487                         return $xml;
00488                 }
00489         }
00490                 // detect type and serialize
00491                 $xml = '';
00492                 switch(true) {
00493                         case (is_bool($val) || $type == 'boolean'):
00494                                 $this->debug("serialize_val: serialize boolean");
00495                         if ($type == 'boolean') {
00496                                 $val = $val ? 'true' : 'false';
00497                         } elseif (! $val) {
00498                                 $val = 0;
00499                         }
00500                                 if ($use == 'literal') {
00501                                         $xml .= "<$name$xmlns$atts>$val</$name>";
00502                                 } else {
00503                                         $xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val</$name>";
00504                                 }
00505                                 break;
00506                         case (is_int($val) || is_long($val) || $type == 'int'):
00507                                 $this->debug("serialize_val: serialize int");
00508                                 if ($use == 'literal') {
00509                                         $xml .= "<$name$xmlns$atts>$val</$name>";
00510                                 } else {
00511                                         $xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val</$name>";
00512                                 }
00513                                 break;
00514                         case (is_float($val)|| is_double($val) || $type == 'float'):
00515                                 $this->debug("serialize_val: serialize float");
00516                                 if ($use == 'literal') {
00517                                         $xml .= "<$name$xmlns$atts>$val</$name>";
00518                                 } else {
00519                                         $xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val</$name>";
00520                                 }
00521                                 break;
00522                         case (is_string($val) || $type == 'string'):
00523                                 $this->debug("serialize_val: serialize string");
00524                                 $val = $this->expandEntities($val);
00525                                 if ($use == 'literal') {
00526                                         $xml .= "<$name$xmlns$atts>$val</$name>";
00527                                 } else {
00528                                         $xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val</$name>";
00529                                 }
00530                                 break;
00531                         case is_object($val):
00532                                 $this->debug("serialize_val: serialize object");
00533                         if (get_class($val) == 'soapval') {
00534                                 $this->debug("serialize_val: serialize soapval object");
00535                                 $pXml = $val->serialize($use);
00536                                         $this->appendDebug($val->getDebug());
00537                                         $val->clearDebug();
00538                         } else {
00539                                         if (! $name) {
00540                                                 $name = get_class($val);
00541                                                 $this->debug("In serialize_val, used class name $name as element name");
00542                                         } else {
00543                                                 $this->debug("In serialize_val, do not override name $name for element name for class " . get_class($val));
00544                                         }
00545                                         foreach(get_object_vars($val) as $k => $v){
00546                                                 $pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use);
00547                                         }
00548                                 }
00549                                 if(isset($type) && isset($type_prefix)){
00550                                         $type_str = " xsi:type=\"$type_prefix:$type\"";
00551                                 } else {
00552                                         $type_str = '';
00553                                 }
00554                                 if ($use == 'literal') {
00555                                         $xml .= "<$name$xmlns$atts>$pXml</$name>";
00556                                 } else {
00557                                         $xml .= "<$name$xmlns$type_str$atts>$pXml</$name>";
00558                                 }
00559                                 break;
00560                         break;
00561                         case (is_array($val) || $type):
00562                                 // detect if struct or array
00563                                 $valueType = $this->isArraySimpleOrStruct($val);
00564                 if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
00565                                         $this->debug("serialize_val: serialize array");
00566                                         $i = 0;
00567                                         if(is_array($val) && count($val)> 0){
00568                                                 foreach($val as $v){
00569                                 if(is_object($v) && get_class($v) ==  'soapval'){
00570                                                                 $tt_ns = $v->type_ns;
00571                                                                 $tt = $v->type;
00572                                                         } elseif (is_array($v)) {
00573                                                                 $tt = $this->isArraySimpleOrStruct($v);
00574                                                         } else {
00575                                                                 $tt = gettype($v);
00576                                 }
00577                                                         $array_types[$tt] = 1;
00578                                                         // TODO: for literal, the name should be $name
00579                                                         $xml .= $this->serialize_val($v,'item',false,false,false,false,$use);
00580                                                         ++$i;
00581                                                 }
00582                                                 if(count($array_types) > 1){
00583                                                         $array_typename = 'xsd:anyType';
00584                                                 } elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) {
00585                                                         if ($tt == 'integer') {
00586                                                                 $tt = 'int';
00587                                                         }
00588                                                         $array_typename = 'xsd:'.$tt;
00589                                                 } elseif(isset($tt) && $tt == 'arraySimple'){
00590                                                         $array_typename = 'SOAP-ENC:Array';
00591                                                 } elseif(isset($tt) && $tt == 'arrayStruct'){
00592                                                         $array_typename = 'unnamed_struct_use_soapval';
00593                                                 } else {
00594                                                         // if type is prefixed, create type prefix
00595                                                         if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){
00596                                                                  $array_typename = 'xsd:' . $tt;
00597                                                         } elseif ($tt_ns) {
00598                                                                 $tt_prefix = 'ns' . rand(1000, 9999);
00599                                                                 $array_typename = "$tt_prefix:$tt";
00600                                                                 $xmlns .= " xmlns:$tt_prefix=\"$tt_ns\"";
00601                                                         } else {
00602                                                                 $array_typename = $tt;
00603                                                         }
00604                                                 }
00605                                                 $array_type = $i;
00606                                                 if ($use == 'literal') {
00607                                                         $type_str = '';
00608                                                 } else if (isset($type) && isset($type_prefix)) {
00609                                                         $type_str = " xsi:type=\"$type_prefix:$type\"";
00610                                                 } else {
00611                                                         $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\"";
00612                                                 }
00613                                         // empty array
00614                                         } else {
00615                                                 if ($use == 'literal') {
00616                                                         $type_str = '';
00617                                                 } else if (isset($type) && isset($type_prefix)) {
00618                                                         $type_str = " xsi:type=\"$type_prefix:$type\"";
00619                                                 } else {
00620                                                         $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\"";
00621                                                 }
00622                                         }
00623                                         // TODO: for array in literal, there is no wrapper here
00624                                         $xml = "<$name$xmlns$type_str$atts>".$xml."</$name>";
00625                                 } else {
00626                                         // got a struct
00627                                         $this->debug("serialize_val: serialize struct");
00628                                         if(isset($type) && isset($type_prefix)){
00629                                                 $type_str = " xsi:type=\"$type_prefix:$type\"";
00630                                         } else {
00631                                                 $type_str = '';
00632                                         }
00633                                         if ($use == 'literal') {
00634                                                 $xml .= "<$name$xmlns$atts>";
00635                                         } else {
00636                                                 $xml .= "<$name$xmlns$type_str$atts>";
00637                                         }
00638                                         foreach($val as $k => $v){
00639                                                 // Apache Map
00640                                                 if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') {
00641                                                         $xml .= '<item>';
00642                                                         $xml .= $this->serialize_val($k,'key',false,false,false,false,$use);
00643                                                         $xml .= $this->serialize_val($v,'value',false,false,false,false,$use);
00644                                                         $xml .= '</item>';
00645                                                 } else {
00646                                                         $xml .= $this->serialize_val($v,$k,false,false,false,false,$use);
00647                                                 }
00648                                         }
00649                                         $xml .= "</$name>";
00650                                 }
00651                                 break;
00652                         default:
00653                                 $this->debug("serialize_val: serialize unknown");
00654                                 $xml .= 'not detected, got '.gettype($val).' for '.$val;
00655                                 break;
00656                 }
00657                 $this->debug("serialize_val returning $xml");
00658                 return $xml;
00659         }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

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

serializes a message

Parameter:
string $body the XML of the SOAP body
mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array
array $namespaces optional the namespaces used in generating the body and headers
string $style optional (rpc|document)
string $use optional (encoded|literal)
string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
Rückgabe:
string the message public

Definiert in Zeile 673 der Datei nusoap.php.

00673                                                                                                                         ://schemas.xmlsoap.org/soap/encoding/'){
00674     // TODO: add an option to automatically run utf8_encode on $body and $headers
00675     // if $this->soap_defencoding is UTF-8.  Not doing this automatically allows
00676     // one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1
00677 
00678         $this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle");
00679         $this->debug("headers:");
00680         $this->appendDebug($this->varDump($headers));
00681         $this->debug("namespaces:");
00682         $this->appendDebug($this->varDump($namespaces));
00683 
00684         // serialize namespaces
00685     $ns_string = '';
00686         foreach(array_merge($this->namespaces,$namespaces) as $k => $v){
00687                 $ns_string .= " xmlns:$k=\"$v\"";
00688         }
00689         if($encodingStyle) {
00690                 $ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string";
00691         }
00692 
00693         // serialize headers
00694         if($headers){
00695                 if (is_array($headers)) {
00696                         $xml = '';
00697                         foreach ($headers as $k => $v) {
00698                                 if (is_object($v) && get_class($v) == 'soapval') {
00699                                         $xml .= $this->serialize_val($v, false, false, false, false, false, $use);
00700                                 } else {
00701                                         $xml .= $this->serialize_val($v, $k, false, false, false, false, $use);
00702                                 }
00703                         }
00704                         $headers = $xml;
00705                         $this->debug("In serializeEnvelope, serialized array of headers to $headers");
00706                 }
00707                 $headers = "<SOAP-ENV:Header>".$headers."</SOAP-ENV:Header>";
00708         }
00709         // serialize envelope
00710         return
00711         '<?xml version="1.0" encoding="'.$this->soap_defencoding .'"?'.">".
00712         '<SOAP-ENV:Envelope'.$ns_string.">".
00713         $headers.
00714         "<SOAP-ENV:Body>".
00715                 $body.
00716         "</SOAP-ENV:Body>".
00717         "</SOAP-ENV:Envelope>";
00718     }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

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

serializes a message

Parameter:
string $body the XML of the SOAP body
mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array
array $namespaces optional the namespaces used in generating the body and headers
string $style optional (rpc|document)
string $use optional (encoded|literal)
string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
Rückgabe:
string the message public

Definiert in Zeile 673 der Datei class.nusoap_base.php.

00673                                                                                                                         ://schemas.xmlsoap.org/soap/encoding/'){
00674     // TODO: add an option to automatically run utf8_encode on $body and $headers
00675     // if $this->soap_defencoding is UTF-8.  Not doing this automatically allows
00676     // one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1
00677 
00678         $this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle");
00679         $this->debug("headers:");
00680         $this->appendDebug($this->varDump($headers));
00681         $this->debug("namespaces:");
00682         $this->appendDebug($this->varDump($namespaces));
00683 
00684         // serialize namespaces
00685     $ns_string = '';
00686         foreach(array_merge($this->namespaces,$namespaces) as $k => $v){
00687                 $ns_string .= " xmlns:$k=\"$v\"";
00688         }
00689         if($encodingStyle) {
00690                 $ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string";
00691         }
00692 
00693         // serialize headers
00694         if($headers){
00695                 if (is_array($headers)) {
00696                         $xml = '';
00697                         foreach ($headers as $k => $v) {
00698                                 if (is_object($v) && get_class($v) == 'soapval') {
00699                                         $xml .= $this->serialize_val($v, false, false, false, false, false, $use);
00700                                 } else {
00701                                         $xml .= $this->serialize_val($v, $k, false, false, false, false, $use);
00702                                 }
00703                         }
00704                         $headers = $xml;
00705                         $this->debug("In serializeEnvelope, serialized array of headers to $headers");
00706                 }
00707                 $headers = "<SOAP-ENV:Header>".$headers."</SOAP-ENV:Header>";
00708         }
00709         // serialize envelope
00710         return
00711         '<?xml version="1.0" encoding="'.$this->soap_defencoding .'"?'.">".
00712         '<SOAP-ENV:Envelope'.$ns_string.">".
00713         $headers.
00714         "<SOAP-ENV:Body>".
00715                 $body.
00716         "</SOAP-ENV:Body>".
00717         "</SOAP-ENV:Envelope>";
00718     }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::setDebugLevel ( level  ) 

sets the debug level for this instance

Parameter:
int $level Debug level 0-9, where 0 turns off public

Definiert in Zeile 265 der Datei nusoap.php.

00265                                        {
00266                 $this->debugLevel = $level;
00267         }

nusoap_base::setDebugLevel ( level  ) 

sets the debug level for this instance

Parameter:
int $level Debug level 0-9, where 0 turns off public

Definiert in Zeile 265 der Datei class.nusoap_base.php.

00265                                        {
00266                 $this->debugLevel = $level;
00267         }

nusoap_base::setError ( str  ) 

sets error string

Rückgabe:
boolean $string error string private

Definiert in Zeile 371 der Datei nusoap.php.

00371                                {
00372                 $this->error_str = $str;
00373         }

nusoap_base::setError ( str  ) 

sets error string

Rückgabe:
boolean $string error string private

Definiert in Zeile 371 der Datei class.nusoap_base.php.

00371                                {
00372                 $this->error_str = $str;
00373         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nusoap_base::setGlobalDebugLevel ( level  ) 

sets the global debug level, which applies to future instances

Parameter:
int $level Debug level 0-9, where 0 turns off public

Definiert in Zeile 245 der Datei nusoap.php.

00245                                              {
00246                 $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'] = $level;
00247         }

nusoap_base::setGlobalDebugLevel ( level  ) 

sets the global debug level, which applies to future instances

Parameter:
int $level Debug level 0-9, where 0 turns off public

Definiert in Zeile 245 der Datei class.nusoap_base.php.

00245                                              {
00246                 $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'] = $level;
00247         }

nusoap_base::varDump ( data  ) 

Returns a string with the output of var_dump

Parameter:
mixed $data The variable to var_dump
Rückgabe:
string The output of var_dump public

Definiert in Zeile 873 der Datei nusoap.php.

00873                             {
00874                 ob_start();
00875                 var_dump($data);
00876                 $ret_val = ob_get_contents();
00877                 ob_end_clean();
00878                 return $ret_val;
00879         }

nusoap_base::varDump ( data  ) 

Returns a string with the output of var_dump

Parameter:
mixed $data The variable to var_dump
Rückgabe:
string The output of var_dump public

Definiert in Zeile 873 der Datei class.nusoap_base.php.

00873                             {
00874                 ob_start();
00875                 var_dump($data);
00876                 $ret_val = ob_get_contents();
00877                 ob_end_clean();
00878                 return $ret_val;
00879         }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:


Dokumentation der Datenelemente

nusoap_base::$charencoding = true

Definiert in Zeile 128 der Datei class.nusoap_base.php.

nusoap_base::$debug_str = ''

Definiert in Zeile 120 der Datei class.nusoap_base.php.

nusoap_base::$debugLevel

Definiert in Zeile 135 der Datei class.nusoap_base.php.

nusoap_base::$error_str = ''

Definiert in Zeile 113 der Datei class.nusoap_base.php.

nusoap_base::$namespaces

Initialisierung:

 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/'
                )

Erneute Implementation in nusoap_parser.

Definiert in Zeile 162 der Datei class.nusoap_base.php.

nusoap_base::$revision = '$Revision: 1.55 $'

Definiert in Zeile 106 der Datei class.nusoap_base.php.

nusoap_base::$soap_defencoding = 'ISO-8859-1'

Definiert in Zeile 151 der Datei class.nusoap_base.php.

nusoap_base::$title = 'NuSOAP'

Definiert in Zeile 92 der Datei class.nusoap_base.php.

nusoap_base::$typemap

Initialisierung:

 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',
                
                'anyType'=>'string','anySimpleType'=>'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/2000/10/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://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')
        )

Definiert in Zeile 184 der Datei class.nusoap_base.php.

nusoap_base::$usedNamespaces = array()

Definiert in Zeile 175 der Datei class.nusoap_base.php.

nusoap_base::$version = '1.0rc1'

Definiert in Zeile 99 der Datei class.nusoap_base.php.

nusoap_base::$xmlEntities

Initialisierung:

 array('quot' => '"','amp' => '&',
                'lt' => '<','gt' => '>','apos' => "'")

Definiert in Zeile 217 der Datei class.nusoap_base.php.

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

Definiert in Zeile 143 der Datei class.nusoap_base.php.


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien:
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved.
MyOOS [Shopsystem] is Free Software released under the GNU/GPL License.

Webmaster: info@r23.de (Impressum)
doxygen