nusoap_parser Klassenreferenz

Klassendiagramm für nusoap_parser:

Inheritance graph
[Legende]
Zusammengehörigkeiten von nusoap_parser:

Collaboration graph
[Legende]

Aufstellung aller Elemente

Öffentliche Methoden

 nusoap_parser ($xml, $encoding='UTF-8', $method='', $decode_utf8=true)
 start_element ($parser, $name, $attrs)
 end_element ($parser, $name)
 character_data ($parser, $data)
 get_response ()
 get_soapbody ()
 get_soapheader ()
 getHeaders ()
 decodeSimple ($value, $type, $typens)
 buildVal ($pos)
 nusoap_parser ($xml, $encoding='UTF-8', $method='', $decode_utf8=true)
 start_element ($parser, $name, $attrs)
 end_element ($parser, $name)
 character_data ($parser, $data)
 get_response ()
 get_soapbody ()
 get_soapheader ()
 getHeaders ()
 decodeSimple ($value, $type, $typens)
 buildVal ($pos)

Öffentliche Attribute

 $xml = ''
 $xml_encoding = ''
 $method = ''
 $root_struct = ''
 $root_struct_name = ''
 $root_struct_namespace = ''
 $root_header = ''
 $document = ''
 $status = ''
 $position = 0
 $depth = 0
 $default_namespace = ''
 $namespaces = array()
 $message = array()
 $parent = ''
 $fault = false
 $fault_code = ''
 $fault_str = ''
 $fault_detail = ''
 $depth_array = array()
 $debug_flag = true
 $soapresponse = NULL
 $soapheader = NULL
 $responseHeaders = ''
 $body_position = 0
 $ids = array()
 $multirefs = array()
 $decode_utf8 = true


Ausführliche Beschreibung

nusoap_parser class parses SOAP XML messages into native PHP values

Autor:
Dietrich Ayala <dietrich@ganx4.com>

Scott Nichol <snichol@users.sourceforge.net>

Version:
Id
class.soap_parser.php,v 1.40 2007/04/17 16:34:03 snichol Exp
public

nusoap_parser class parses SOAP XML messages into native PHP values

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 15 der Datei class.soap_parser.php.


Dokumentation der Elementfunktionen

nusoap_parser::buildVal ( pos  ) 

builds response structures for compound values (arrays/structs) and scalars

Parameter:
integer $pos position in node tree
Rückgabe:
mixed PHP value private

Definiert in Zeile 6996 der Datei nusoap.php.

06996                                {
06997                 if(!isset($this->message[$pos]['type'])){
06998                         $this->message[$pos]['type'] = '';
06999                 }
07000                 $this->debug('in buildVal() for '.$this->message[$pos]['name']."(pos $pos) of type ".$this->message[$pos]['type']);
07001                 // if there are children...
07002                 if($this->message[$pos]['children'] != ''){
07003                         $this->debug('in buildVal, there are children');
07004                         $children = explode('|',$this->message[$pos]['children']);
07005                         array_shift($children); // knock off empty
07006                         // md array
07007                         if(isset($this->message[$pos]['arrayCols']) && $this->message[$pos]['arrayCols'] != ''){
07008                 $r=0; // rowcount
07009                 $c=0; // colcount
07010                 foreach($children as $child_pos){
07011                                         $this->debug("in buildVal, got an MD array element: $r, $c");
07012                                         $params[$r][] = $this->message[$child_pos]['result'];
07013                                     $c++;
07014                                     if($c == $this->message[$pos]['arrayCols']){
07015                                         $c = 0;
07016                                                 $r++;
07017                                     }
07018                 }
07019             // array
07020                         } elseif($this->message[$pos]['type'] == 'array' || $this->message[$pos]['type'] == 'Array'){
07021                 $this->debug('in buildVal, adding array '.$this->message[$pos]['name']);
07022                 foreach($children as $child_pos){
07023                         $params[] = &$this->message[$child_pos]['result'];
07024                 }
07025             // apache Map type: java hashtable
07026             } elseif($this->message[$pos]['type'] == 'Map' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap'){
07027                 $this->debug('in buildVal, Java Map '.$this->message[$pos]['name']);
07028                 foreach($children as $child_pos){
07029                         $kv = explode("|",$this->message[$child_pos]['children']);
07030                         $params[$this->message[$kv[1]]['result']] = &$this->message[$kv[2]]['result'];
07031                 }
07032             // generic compound type
07033             //} elseif($this->message[$pos]['type'] == 'SOAPStruct' || $this->message[$pos]['type'] == 'struct') {
07034                     } else {
07035                         // Apache Vector type: treat as an array
07036                 $this->debug('in buildVal, adding Java Vector or generic compound type '.$this->message[$pos]['name']);
07037                                 if ($this->message[$pos]['type'] == 'Vector' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap') {
07038                                         $notstruct = 1;
07039                                 } else {
07040                                         $notstruct = 0;
07041                     }
07042                 //
07043                 foreach($children as $child_pos){
07044                         if($notstruct){
07045                                 $params[] = &$this->message[$child_pos]['result'];
07046                         } else {
07047                                 if (isset($params[$this->message[$child_pos]['name']])) {
07048                                         // de-serialize repeated element name into an array
07049                                         if ((!is_array($params[$this->message[$child_pos]['name']])) || (!isset($params[$this->message[$child_pos]['name']][0]))) {
07050                                                 $params[$this->message[$child_pos]['name']] = array($params[$this->message[$child_pos]['name']]);
07051                                         }
07052                                         $params[$this->message[$child_pos]['name']][] = &$this->message[$child_pos]['result'];
07053                                 } else {
07054                                                 $params[$this->message[$child_pos]['name']] = &$this->message[$child_pos]['result'];
07055                                             }
07056                         }
07057                 }
07058                         }
07059                         if (isset($this->message[$pos]['xattrs'])) {
07060                 $this->debug('in buildVal, handling attributes');
07061                                 foreach ($this->message[$pos]['xattrs'] as $n => $v) {
07062                                         $params[$n] = $v;
07063                                 }
07064                         }
07065                         // handle simpleContent
07066                         if (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') {
07067                 $this->debug('in buildVal, handling simpleContent');
07068                 if (isset($this->message[$pos]['type'])) {
07069                                         $params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
07070                                 } else {
07071                                         $parent = $this->message[$pos]['parent'];
07072                                         if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
07073                                                 $params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
07074                                         } else {
07075                                                 $params['!'] = $this->message[$pos]['cdata'];
07076                                         }
07077                                 }
07078                         }
07079                         $ret = is_array($params) ? $params : array();
07080                         $this->debug('in buildVal, return:');
07081                         $this->appendDebug($this->varDump($ret));
07082                         return $ret;
07083                 } else {
07084                 $this->debug('in buildVal, no children, building scalar');
07085                         $cdata = isset($this->message[$pos]['cdata']) ? $this->message[$pos]['cdata'] : '';
07086                 if (isset($this->message[$pos]['type'])) {
07087                                 $ret = $this->decodeSimple($cdata, $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
07088                                 $this->debug("in buildVal, return: $ret");
07089                                 return $ret;
07090                         }
07091                         $parent = $this->message[$pos]['parent'];
07092                         if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
07093                                 $ret = $this->decodeSimple($cdata, $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
07094                                 $this->debug("in buildVal, return: $ret");
07095                                 return $ret;
07096                         }
07097                 $ret = $this->message[$pos]['cdata'];
07098                         $this->debug("in buildVal, return: $ret");
07099                 return $ret;
07100                 }
07101         }

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

nusoap_parser::buildVal ( pos  ) 

builds response structures for compound values (arrays/structs) and scalars

Parameter:
integer $pos position in node tree
Rückgabe:
mixed PHP value private

Definiert in Zeile 524 der Datei class.soap_parser.php.

00524                                {
00525                 if(!isset($this->message[$pos]['type'])){
00526                         $this->message[$pos]['type'] = '';
00527                 }
00528                 $this->debug('in buildVal() for '.$this->message[$pos]['name']."(pos $pos) of type ".$this->message[$pos]['type']);
00529                 // if there are children...
00530                 if($this->message[$pos]['children'] != ''){
00531                         $this->debug('in buildVal, there are children');
00532                         $children = explode('|',$this->message[$pos]['children']);
00533                         array_shift($children); // knock off empty
00534                         // md array
00535                         if(isset($this->message[$pos]['arrayCols']) && $this->message[$pos]['arrayCols'] != ''){
00536                 $r=0; // rowcount
00537                 $c=0; // colcount
00538                 foreach($children as $child_pos){
00539                                         $this->debug("in buildVal, got an MD array element: $r, $c");
00540                                         $params[$r][] = $this->message[$child_pos]['result'];
00541                                     $c++;
00542                                     if($c == $this->message[$pos]['arrayCols']){
00543                                         $c = 0;
00544                                                 $r++;
00545                                     }
00546                 }
00547             // array
00548                         } elseif($this->message[$pos]['type'] == 'array' || $this->message[$pos]['type'] == 'Array'){
00549                 $this->debug('in buildVal, adding array '.$this->message[$pos]['name']);
00550                 foreach($children as $child_pos){
00551                         $params[] = &$this->message[$child_pos]['result'];
00552                 }
00553             // apache Map type: java hashtable
00554             } elseif($this->message[$pos]['type'] == 'Map' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap'){
00555                 $this->debug('in buildVal, Java Map '.$this->message[$pos]['name']);
00556                 foreach($children as $child_pos){
00557                         $kv = explode("|",$this->message[$child_pos]['children']);
00558                         $params[$this->message[$kv[1]]['result']] = &$this->message[$kv[2]]['result'];
00559                 }
00560             // generic compound type
00561             //} elseif($this->message[$pos]['type'] == 'SOAPStruct' || $this->message[$pos]['type'] == 'struct') {
00562                     } else {
00563                         // Apache Vector type: treat as an array
00564                 $this->debug('in buildVal, adding Java Vector or generic compound type '.$this->message[$pos]['name']);
00565                                 if ($this->message[$pos]['type'] == 'Vector' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap') {
00566                                         $notstruct = 1;
00567                                 } else {
00568                                         $notstruct = 0;
00569                     }
00570                 //
00571                 foreach($children as $child_pos){
00572                         if($notstruct){
00573                                 $params[] = &$this->message[$child_pos]['result'];
00574                         } else {
00575                                 if (isset($params[$this->message[$child_pos]['name']])) {
00576                                         // de-serialize repeated element name into an array
00577                                         if ((!is_array($params[$this->message[$child_pos]['name']])) || (!isset($params[$this->message[$child_pos]['name']][0]))) {
00578                                                 $params[$this->message[$child_pos]['name']] = array($params[$this->message[$child_pos]['name']]);
00579                                         }
00580                                         $params[$this->message[$child_pos]['name']][] = &$this->message[$child_pos]['result'];
00581                                 } else {
00582                                                 $params[$this->message[$child_pos]['name']] = &$this->message[$child_pos]['result'];
00583                                             }
00584                         }
00585                 }
00586                         }
00587                         if (isset($this->message[$pos]['xattrs'])) {
00588                 $this->debug('in buildVal, handling attributes');
00589                                 foreach ($this->message[$pos]['xattrs'] as $n => $v) {
00590                                         $params[$n] = $v;
00591                                 }
00592                         }
00593                         // handle simpleContent
00594                         if (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') {
00595                 $this->debug('in buildVal, handling simpleContent');
00596                 if (isset($this->message[$pos]['type'])) {
00597                                         $params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
00598                                 } else {
00599                                         $parent = $this->message[$pos]['parent'];
00600                                         if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
00601                                                 $params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
00602                                         } else {
00603                                                 $params['!'] = $this->message[$pos]['cdata'];
00604                                         }
00605                                 }
00606                         }
00607                         $ret = is_array($params) ? $params : array();
00608                         $this->debug('in buildVal, return:');
00609                         $this->appendDebug($this->varDump($ret));
00610                         return $ret;
00611                 } else {
00612                 $this->debug('in buildVal, no children, building scalar');
00613                         $cdata = isset($this->message[$pos]['cdata']) ? $this->message[$pos]['cdata'] : '';
00614                 if (isset($this->message[$pos]['type'])) {
00615                                 $ret = $this->decodeSimple($cdata, $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
00616                                 $this->debug("in buildVal, return: $ret");
00617                                 return $ret;
00618                         }
00619                         $parent = $this->message[$pos]['parent'];
00620                         if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
00621                                 $ret = $this->decodeSimple($cdata, $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
00622                                 $this->debug("in buildVal, return: $ret");
00623                                 return $ret;
00624                         }
00625                 $ret = $this->message[$pos]['cdata'];
00626                         $this->debug("in buildVal, return: $ret");
00627                 return $ret;
00628                 }
00629         }

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

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

nusoap_parser::character_data ( parser,
data 
)

element content handler

Parameter:
resource $parser XML parser object
string $data element content private

Definiert in Zeile 6883 der Datei nusoap.php.

06883                                                {
06884                 $pos = $this->depth_array[$this->depth];
06885                 if ($this->xml_encoding=='UTF-8'){
06886                         // TODO: add an option to disable this for folks who want
06887                         // raw UTF-8 that, e.g., might not map to iso-8859-1
06888                         // TODO: this can also be handled with xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1");
06889                         if($this->decode_utf8){
06890                                 $data = utf8_decode($data);
06891                         }
06892                 }
06893         $this->message[$pos]['cdata'] .= $data;
06894         // for doclit
06895         if($this->status == 'header'){
06896                 $this->responseHeaders .= $data;
06897         } else {
06898                 $this->document .= $data;
06899         }
06900         }

nusoap_parser::character_data ( parser,
data 
)

element content handler

Parameter:
resource $parser XML parser object
string $data element content private

Definiert in Zeile 411 der Datei class.soap_parser.php.

00411                                                {
00412                 $pos = $this->depth_array[$this->depth];
00413                 if ($this->xml_encoding=='UTF-8'){
00414                         // TODO: add an option to disable this for folks who want
00415                         // raw UTF-8 that, e.g., might not map to iso-8859-1
00416                         // TODO: this can also be handled with xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1");
00417                         if($this->decode_utf8){
00418                                 $data = utf8_decode($data);
00419                         }
00420                 }
00421         $this->message[$pos]['cdata'] .= $data;
00422         // for doclit
00423         if($this->status == 'header'){
00424                 $this->responseHeaders .= $data;
00425         } else {
00426                 $this->document .= $data;
00427         }
00428         }

nusoap_parser::decodeSimple ( value,
type,
typens 
)

decodes simple types into PHP variables

Parameter:
string $value value to decode
string $type XML type to decode
string $typens XML type namespace to decode
Rückgabe:
mixed PHP value private

Definiert in Zeile 6952 der Datei nusoap.php.

06952                                                       {
06953                 // TODO: use the namespace!
06954                 if ((!isset($type)) || $type == 'string' || $type == 'long' || $type == 'unsignedLong') {
06955                         return (string) $value;
06956                 }
06957                 if ($type == 'int' || $type == 'integer' || $type == 'short' || $type == 'byte') {
06958                         return (int) $value;
06959                 }
06960                 if ($type == 'float' || $type == 'double' || $type == 'decimal') {
06961                         return (double) $value;
06962                 }
06963                 if ($type == 'boolean') {
06964                         if (strtolower($value) == 'false' || strtolower($value) == 'f') {
06965                                 return false;
06966                         }
06967                         return (boolean) $value;
06968                 }
06969                 if ($type == 'base64' || $type == 'base64Binary') {
06970                         $this->debug('Decode base64 value');
06971                         return base64_decode($value);
06972                 }
06973                 // obscure numeric types
06974                 if ($type == 'nonPositiveInteger' || $type == 'negativeInteger'
06975                         || $type == 'nonNegativeInteger' || $type == 'positiveInteger'
06976                         || $type == 'unsignedInt'
06977                         || $type == 'unsignedShort' || $type == 'unsignedByte') {
06978                         return (int) $value;
06979                 }
06980                 // bogus: parser treats array with no elements as a simple type
06981                 if ($type == 'array') {
06982                         return array();
06983                 }
06984                 // everything else
06985                 return (string) $value;
06986         }

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

nusoap_parser::decodeSimple ( value,
type,
typens 
)

decodes simple types into PHP variables

Parameter:
string $value value to decode
string $type XML type to decode
string $typens XML type namespace to decode
Rückgabe:
mixed PHP value private

Definiert in Zeile 480 der Datei class.soap_parser.php.

00480                                                       {
00481                 // TODO: use the namespace!
00482                 if ((!isset($type)) || $type == 'string' || $type == 'long' || $type == 'unsignedLong') {
00483                         return (string) $value;
00484                 }
00485                 if ($type == 'int' || $type == 'integer' || $type == 'short' || $type == 'byte') {
00486                         return (int) $value;
00487                 }
00488                 if ($type == 'float' || $type == 'double' || $type == 'decimal') {
00489                         return (double) $value;
00490                 }
00491                 if ($type == 'boolean') {
00492                         if (strtolower($value) == 'false' || strtolower($value) == 'f') {
00493                                 return false;
00494                         }
00495                         return (boolean) $value;
00496                 }
00497                 if ($type == 'base64' || $type == 'base64Binary') {
00498                         $this->debug('Decode base64 value');
00499                         return base64_decode($value);
00500                 }
00501                 // obscure numeric types
00502                 if ($type == 'nonPositiveInteger' || $type == 'negativeInteger'
00503                         || $type == 'nonNegativeInteger' || $type == 'positiveInteger'
00504                         || $type == 'unsignedInt'
00505                         || $type == 'unsignedShort' || $type == 'unsignedByte') {
00506                         return (int) $value;
00507                 }
00508                 // bogus: parser treats array with no elements as a simple type
00509                 if ($type == 'array') {
00510                         return array();
00511                 }
00512                 // everything else
00513                 return (string) $value;
00514         }

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

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

nusoap_parser::end_element ( parser,
name 
)

end-element handler

Parameter:
resource $parser XML parser object
string $name element name private

Definiert in Zeile 6779 der Datei nusoap.php.

06779                                              {
06780                 // position of current element is equal to the last value left in depth_array for my depth
06781                 $pos = $this->depth_array[$this->depth--];
06782 
06783         // get element prefix
06784                 if(strpos($name,':')){
06785                         // get ns prefix
06786                         $prefix = substr($name,0,strpos($name,':'));
06787                         // get unqualified name
06788                         $name = substr(strstr($name,':'),1);
06789                 }
06790                 
06791                 // build to native type
06792                 if(isset($this->body_position) && $pos > $this->body_position){
06793                         // deal w/ multirefs
06794                         if(isset($this->message[$pos]['attrs']['href'])){
06795                                 // get id
06796                                 $id = substr($this->message[$pos]['attrs']['href'],1);
06797                                 // add placeholder to href array
06798                                 $this->multirefs[$id][$pos] = 'placeholder';
06799                                 // add set a reference to it as the result value
06800                                 $this->message[$pos]['result'] =& $this->multirefs[$id][$pos];
06801             // build complexType values
06802                         } elseif($this->message[$pos]['children'] != ''){
06803                                 // if result has already been generated (struct/array)
06804                                 if(!isset($this->message[$pos]['result'])){
06805                                         $this->message[$pos]['result'] = $this->buildVal($pos);
06806                                 }
06807                         // build complexType values of attributes and possibly simpleContent
06808                         } elseif (isset($this->message[$pos]['xattrs'])) {
06809                                 if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) {
06810                                         $this->message[$pos]['xattrs']['!'] = null;
06811                                 } elseif (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') {
06812                         if (isset($this->message[$pos]['type'])) {
06813                                                 $this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
06814                                         } else {
06815                                                 $parent = $this->message[$pos]['parent'];
06816                                                 if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
06817                                                         $this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
06818                                                 } else {
06819                                                         $this->message[$pos]['xattrs']['!'] = $this->message[$pos]['cdata'];
06820                                                 }
06821                                         }
06822                                 }
06823                                 $this->message[$pos]['result'] = $this->message[$pos]['xattrs'];
06824                         // set value of simpleType (or nil complexType)
06825                         } else {
06826                 //$this->debug('adding data for scalar value '.$this->message[$pos]['name'].' of value '.$this->message[$pos]['cdata']);
06827                                 if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) {
06828                                         $this->message[$pos]['xattrs']['!'] = null;
06829                                 } elseif (isset($this->message[$pos]['type'])) {
06830                                         $this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
06831                                 } else {
06832                                         $parent = $this->message[$pos]['parent'];
06833                                         if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
06834                                                 $this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
06835                                         } else {
06836                                                 $this->message[$pos]['result'] = $this->message[$pos]['cdata'];
06837                                         }
06838                                 }
06839 
06840                                 /* add value to parent's result, if parent is struct/array
06841                                 $parent = $this->message[$pos]['parent'];
06842                                 if($this->message[$parent]['type'] != 'map'){
06843                                         if(strtolower($this->message[$parent]['type']) == 'array'){
06844                                                 $this->message[$parent]['result'][] = $this->message[$pos]['result'];
06845                                         } else {
06846                                                 $this->message[$parent]['result'][$this->message[$pos]['name']] = $this->message[$pos]['result'];
06847                                         }
06848                                 }
06849                                 */
06850                         }
06851                 }
06852                 
06853         // for doclit
06854         if($this->status == 'header'){
06855                 if ($this->root_header != $pos) {
06856                         $this->responseHeaders .= "</" . (isset($prefix) ? $prefix . ':' : '') . "$name>";
06857                 }
06858         } elseif($pos >= $this->root_struct){
06859                 $this->document .= "</" . (isset($prefix) ? $prefix . ':' : '') . "$name>";
06860         }
06861                 // switch status
06862                 if($pos == $this->root_struct){
06863                         $this->status = 'body';
06864                         $this->root_struct_namespace = $this->message[$pos]['namespace'];
06865                 } elseif($name == 'Body'){
06866                         $this->status = 'envelope';
06867                  } elseif($name == 'Header'){
06868                         $this->status = 'envelope';
06869                 } elseif($name == 'Envelope'){
06870                         //
06871                 }
06872                 // set parent back to my parent
06873                 $this->parent = $this->message[$pos]['parent'];
06874         }

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

nusoap_parser::end_element ( parser,
name 
)

end-element handler

Parameter:
resource $parser XML parser object
string $name element name private

Definiert in Zeile 307 der Datei class.soap_parser.php.

00307                                              {
00308                 // position of current element is equal to the last value left in depth_array for my depth
00309                 $pos = $this->depth_array[$this->depth--];
00310 
00311         // get element prefix
00312                 if(strpos($name,':')){
00313                         // get ns prefix
00314                         $prefix = substr($name,0,strpos($name,':'));
00315                         // get unqualified name
00316                         $name = substr(strstr($name,':'),1);
00317                 }
00318                 
00319                 // build to native type
00320                 if(isset($this->body_position) && $pos > $this->body_position){
00321                         // deal w/ multirefs
00322                         if(isset($this->message[$pos]['attrs']['href'])){
00323                                 // get id
00324                                 $id = substr($this->message[$pos]['attrs']['href'],1);
00325                                 // add placeholder to href array
00326                                 $this->multirefs[$id][$pos] = 'placeholder';
00327                                 // add set a reference to it as the result value
00328                                 $this->message[$pos]['result'] =& $this->multirefs[$id][$pos];
00329             // build complexType values
00330                         } elseif($this->message[$pos]['children'] != ''){
00331                                 // if result has already been generated (struct/array)
00332                                 if(!isset($this->message[$pos]['result'])){
00333                                         $this->message[$pos]['result'] = $this->buildVal($pos);
00334                                 }
00335                         // build complexType values of attributes and possibly simpleContent
00336                         } elseif (isset($this->message[$pos]['xattrs'])) {
00337                                 if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) {
00338                                         $this->message[$pos]['xattrs']['!'] = null;
00339                                 } elseif (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') {
00340                         if (isset($this->message[$pos]['type'])) {
00341                                                 $this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
00342                                         } else {
00343                                                 $parent = $this->message[$pos]['parent'];
00344                                                 if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
00345                                                         $this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
00346                                                 } else {
00347                                                         $this->message[$pos]['xattrs']['!'] = $this->message[$pos]['cdata'];
00348                                                 }
00349                                         }
00350                                 }
00351                                 $this->message[$pos]['result'] = $this->message[$pos]['xattrs'];
00352                         // set value of simpleType (or nil complexType)
00353                         } else {
00354                 //$this->debug('adding data for scalar value '.$this->message[$pos]['name'].' of value '.$this->message[$pos]['cdata']);
00355                                 if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) {
00356                                         $this->message[$pos]['xattrs']['!'] = null;
00357                                 } elseif (isset($this->message[$pos]['type'])) {
00358                                         $this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
00359                                 } else {
00360                                         $parent = $this->message[$pos]['parent'];
00361                                         if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
00362                                                 $this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
00363                                         } else {
00364                                                 $this->message[$pos]['result'] = $this->message[$pos]['cdata'];
00365                                         }
00366                                 }
00367 
00368                                 /* add value to parent's result, if parent is struct/array
00369                                 $parent = $this->message[$pos]['parent'];
00370                                 if($this->message[$parent]['type'] != 'map'){
00371                                         if(strtolower($this->message[$parent]['type']) == 'array'){
00372                                                 $this->message[$parent]['result'][] = $this->message[$pos]['result'];
00373                                         } else {
00374                                                 $this->message[$parent]['result'][$this->message[$pos]['name']] = $this->message[$pos]['result'];
00375                                         }
00376                                 }
00377                                 */
00378                         }
00379                 }
00380                 
00381         // for doclit
00382         if($this->status == 'header'){
00383                 if ($this->root_header != $pos) {
00384                         $this->responseHeaders .= "</" . (isset($prefix) ? $prefix . ':' : '') . "$name>";
00385                 }
00386         } elseif($pos >= $this->root_struct){
00387                 $this->document .= "</" . (isset($prefix) ? $prefix . ':' : '') . "$name>";
00388         }
00389                 // switch status
00390                 if($pos == $this->root_struct){
00391                         $this->status = 'body';
00392                         $this->root_struct_namespace = $this->message[$pos]['namespace'];
00393                 } elseif($name == 'Body'){
00394                         $this->status = 'envelope';
00395                  } elseif($name == 'Header'){
00396                         $this->status = 'envelope';
00397                 } elseif($name == 'Envelope'){
00398                         //
00399                 }
00400                 // set parent back to my parent
00401                 $this->parent = $this->message[$pos]['parent'];
00402         }

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

nusoap_parser::get_response (  ) 

get the parsed message (SOAP Body)

Rückgabe:
mixed public
Veraltet:
use get_soapbody instead

Definiert in Zeile 6909 der Datei nusoap.php.

06909                                {
06910                 return $this->soapresponse;
06911         }

nusoap_parser::get_response (  ) 

get the parsed message (SOAP Body)

Rückgabe:
mixed public
Veraltet:
use get_soapbody instead

Definiert in Zeile 437 der Datei class.soap_parser.php.

00437                                {
00438                 return $this->soapresponse;
00439         }

nusoap_parser::get_soapbody (  ) 

get the parsed SOAP Body (NULL if there was none)

Rückgabe:
mixed public

Definiert in Zeile 6919 der Datei nusoap.php.

06919                                {
06920                 return $this->soapresponse;
06921         }

nusoap_parser::get_soapbody (  ) 

get the parsed SOAP Body (NULL if there was none)

Rückgabe:
mixed public

Definiert in Zeile 447 der Datei class.soap_parser.php.

00447                                {
00448                 return $this->soapresponse;
00449         }

nusoap_parser::get_soapheader (  ) 

get the parsed SOAP Header (NULL if there was none)

Rückgabe:
mixed public

Definiert in Zeile 6929 der Datei nusoap.php.

06929                                  {
06930                 return $this->soapheader;
06931         }

nusoap_parser::get_soapheader (  ) 

get the parsed SOAP Header (NULL if there was none)

Rückgabe:
mixed public

Definiert in Zeile 457 der Datei class.soap_parser.php.

00457                                  {
00458                 return $this->soapheader;
00459         }

nusoap_parser::getHeaders (  ) 

get the unparsed SOAP Header

Rückgabe:
string XML or empty if no Header public

Definiert in Zeile 6939 der Datei nusoap.php.

06939                              {
06940             return $this->responseHeaders;
06941         }

nusoap_parser::getHeaders (  ) 

get the unparsed SOAP Header

Rückgabe:
string XML or empty if no Header public

Definiert in Zeile 467 der Datei class.soap_parser.php.

00467                              {
00468             return $this->responseHeaders;
00469         }

nusoap_parser::nusoap_parser ( xml,
encoding = 'UTF-8',
method = '',
decode_utf8 = true 
)

constructor that actually does the parsing

Parameter:
string $xml SOAP message
string $encoding character encoding scheme of message
string $method method for which XML is parsed (unused?)
string $decode_utf8 whether to decode UTF-8 to ISO-8859-1 public

Definiert in Zeile 6532 der Datei nusoap.php.

06532                                                                                    {
06533                 parent::nusoap_base();
06534                 $this->xml = $xml;
06535                 $this->xml_encoding = $encoding;
06536                 $this->method = $method;
06537                 $this->decode_utf8 = $decode_utf8;
06538 
06539                 // Check whether content has been read.
06540                 if(!empty($xml)){
06541                         // Check XML encoding
06542                         $pos_xml = strpos($xml, '<?xml');
06543                         if ($pos_xml !== FALSE) {
06544                                 $xml_decl = substr($xml, $pos_xml, strpos($xml, '?>', $pos_xml + 2) - $pos_xml + 1);
06545                                 if (preg_match("/encoding=[\"']([^\"']*)[\"']/", $xml_decl, $res)) {
06546                                         $xml_encoding = $res[1];
06547                                         if (strtoupper($xml_encoding) != $encoding) {
06548                                                 $err = "Charset from HTTP Content-Type '" . $encoding . "' does not match encoding from XML declaration '" . $xml_encoding . "'";
06549                                                 $this->debug($err);
06550                                                 if ($encoding != 'ISO-8859-1' || strtoupper($xml_encoding) != 'UTF-8') {
06551                                                         $this->setError($err);
06552                                                         return;
06553                                                 }
06554                                                 // when HTTP says ISO-8859-1 (the default) and XML says UTF-8 (the typical), assume the other endpoint is just sloppy and proceed
06555                                         } else {
06556                                                 $this->debug('Charset from HTTP Content-Type matches encoding from XML declaration');
06557                                         }
06558                                 } else {
06559                                         $this->debug('No encoding specified in XML declaration');
06560                                 }
06561                         } else {
06562                                 $this->debug('No XML declaration');
06563                         }
06564                         $this->debug('Entering nusoap_parser(), length='.strlen($xml).', encoding='.$encoding);
06565                         // Create an XML parser - why not xml_parser_create_ns?
06566                         $this->parser = xml_parser_create($this->xml_encoding);
06567                         // Set the options for parsing the XML data.
06568                         //xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
06569                         xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
06570                         xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->xml_encoding);
06571                         // Set the object for the parser.
06572                         xml_set_object($this->parser, $this);
06573                         // Set the element handlers for the parser.
06574                         xml_set_element_handler($this->parser, 'start_element','end_element');
06575                         xml_set_character_data_handler($this->parser,'character_data');
06576 
06577                         // Parse the XML file.
06578                         if(!xml_parse($this->parser,$xml,true)){
06579                             // Display an error message.
06580                             $err = sprintf('XML error parsing SOAP payload on line %d: %s',
06581                             xml_get_current_line_number($this->parser),
06582                             xml_error_string(xml_get_error_code($this->parser)));
06583                                 $this->debug($err);
06584                                 $this->debug("XML payload:\n" . $xml);
06585                                 $this->setError($err);
06586                         } else {
06587                                 $this->debug('parsed successfully, found root struct: '.$this->root_struct.' of name '.$this->root_struct_name);
06588                                 // get final value
06589                                 $this->soapresponse = $this->message[$this->root_struct]['result'];
06590                                 // get header value
06591                                 if($this->root_header != '' && isset($this->message[$this->root_header]['result'])){
06592                                         $this->soapheader = $this->message[$this->root_header]['result'];
06593                                 }
06594                                 // resolve hrefs/ids
06595                                 if(sizeof($this->multirefs) > 0){
06596                                         foreach($this->multirefs as $id => $hrefs){
06597                                                 $this->debug('resolving multirefs for id: '.$id);
06598                                                 $idVal = $this->buildVal($this->ids[$id]);
06599                                                 if (is_array($idVal) && isset($idVal['!id'])) {
06600                                                         unset($idVal['!id']);
06601                                                 }
06602                                                 foreach($hrefs as $refPos => $ref){
06603                                                         $this->debug('resolving href at pos '.$refPos);
06604                                                         $this->multirefs[$id][$refPos] = $idVal;
06605                                                 }
06606                                         }
06607                                 }
06608                         }
06609                         xml_parser_free($this->parser);
06610                 } else {
06611                         $this->debug('xml was empty, didn\'t parse!');
06612                         $this->setError('xml was empty, didn\'t parse!');
06613                 }
06614         }

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

nusoap_parser::nusoap_parser ( xml,
encoding = 'UTF-8',
method = '',
decode_utf8 = true 
)

constructor that actually does the parsing

Parameter:
string $xml SOAP message
string $encoding character encoding scheme of message
string $method method for which XML is parsed (unused?)
string $decode_utf8 whether to decode UTF-8 to ISO-8859-1 public

Definiert in Zeile 60 der Datei class.soap_parser.php.

00060                                                                                    {
00061                 parent::nusoap_base();
00062                 $this->xml = $xml;
00063                 $this->xml_encoding = $encoding;
00064                 $this->method = $method;
00065                 $this->decode_utf8 = $decode_utf8;
00066 
00067                 // Check whether content has been read.
00068                 if(!empty($xml)){
00069                         // Check XML encoding
00070                         $pos_xml = strpos($xml, '<?xml');
00071                         if ($pos_xml !== FALSE) {
00072                                 $xml_decl = substr($xml, $pos_xml, strpos($xml, '?>', $pos_xml + 2) - $pos_xml + 1);
00073                                 if (preg_match("/encoding=[\"']([^\"']*)[\"']/", $xml_decl, $res)) {
00074                                         $xml_encoding = $res[1];
00075                                         if (strtoupper($xml_encoding) != $encoding) {
00076                                                 $err = "Charset from HTTP Content-Type '" . $encoding . "' does not match encoding from XML declaration '" . $xml_encoding . "'";
00077                                                 $this->debug($err);
00078                                                 if ($encoding != 'ISO-8859-1' || strtoupper($xml_encoding) != 'UTF-8') {
00079                                                         $this->setError($err);
00080                                                         return;
00081                                                 }
00082                                                 // when HTTP says ISO-8859-1 (the default) and XML says UTF-8 (the typical), assume the other endpoint is just sloppy and proceed
00083                                         } else {
00084                                                 $this->debug('Charset from HTTP Content-Type matches encoding from XML declaration');
00085                                         }
00086                                 } else {
00087                                         $this->debug('No encoding specified in XML declaration');
00088                                 }
00089                         } else {
00090                                 $this->debug('No XML declaration');
00091                         }
00092                         $this->debug('Entering nusoap_parser(), length='.strlen($xml).', encoding='.$encoding);
00093                         // Create an XML parser - why not xml_parser_create_ns?
00094                         $this->parser = xml_parser_create($this->xml_encoding);
00095                         // Set the options for parsing the XML data.
00096                         //xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
00097                         xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
00098                         xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->xml_encoding);
00099                         // Set the object for the parser.
00100                         xml_set_object($this->parser, $this);
00101                         // Set the element handlers for the parser.
00102                         xml_set_element_handler($this->parser, 'start_element','end_element');
00103                         xml_set_character_data_handler($this->parser,'character_data');
00104 
00105                         // Parse the XML file.
00106                         if(!xml_parse($this->parser,$xml,true)){
00107                             // Display an error message.
00108                             $err = sprintf('XML error parsing SOAP payload on line %d: %s',
00109                             xml_get_current_line_number($this->parser),
00110                             xml_error_string(xml_get_error_code($this->parser)));
00111                                 $this->debug($err);
00112                                 $this->debug("XML payload:\n" . $xml);
00113                                 $this->setError($err);
00114                         } else {
00115                                 $this->debug('parsed successfully, found root struct: '.$this->root_struct.' of name '.$this->root_struct_name);
00116                                 // get final value
00117                                 $this->soapresponse = $this->message[$this->root_struct]['result'];
00118                                 // get header value
00119                                 if($this->root_header != '' && isset($this->message[$this->root_header]['result'])){
00120                                         $this->soapheader = $this->message[$this->root_header]['result'];
00121                                 }
00122                                 // resolve hrefs/ids
00123                                 if(sizeof($this->multirefs) > 0){
00124                                         foreach($this->multirefs as $id => $hrefs){
00125                                                 $this->debug('resolving multirefs for id: '.$id);
00126                                                 $idVal = $this->buildVal($this->ids[$id]);
00127                                                 if (is_array($idVal) && isset($idVal['!id'])) {
00128                                                         unset($idVal['!id']);
00129                                                 }
00130                                                 foreach($hrefs as $refPos => $ref){
00131                                                         $this->debug('resolving href at pos '.$refPos);
00132                                                         $this->multirefs[$id][$refPos] = $idVal;
00133                                                 }
00134                                         }
00135                                 }
00136                         }
00137                         xml_parser_free($this->parser);
00138                 } else {
00139                         $this->debug('xml was empty, didn\'t parse!');
00140                         $this->setError('xml was empty, didn\'t parse!');
00141                 }
00142         }

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

nusoap_parser::start_element ( parser,
name,
attrs 
)

start-element handler

Parameter:
resource $parser XML parser object
string $name element name
array $attrs associative array of attributes private

Definiert in Zeile 6624 der Datei nusoap.php.

06624                                                        {
06625                 // position in a total number of elements, starting from 0
06626                 // update class level pos
06627                 $pos = $this->position++;
06628                 // and set mine
06629                 $this->message[$pos] = array('pos' => $pos,'children'=>'','cdata'=>'');
06630                 // depth = how many levels removed from root?
06631                 // set mine as current global depth and increment global depth value
06632                 $this->message[$pos]['depth'] = $this->depth++;
06633 
06634                 // else add self as child to whoever the current parent is
06635                 if($pos != 0){
06636                         $this->message[$this->parent]['children'] .= '|'.$pos;
06637                 }
06638                 // set my parent
06639                 $this->message[$pos]['parent'] = $this->parent;
06640                 // set self as current parent
06641                 $this->parent = $pos;
06642                 // set self as current value for this depth
06643                 $this->depth_array[$this->depth] = $pos;
06644                 // get element prefix
06645                 if(strpos($name,':')){
06646                         // get ns prefix
06647                         $prefix = substr($name,0,strpos($name,':'));
06648                         // get unqualified name
06649                         $name = substr(strstr($name,':'),1);
06650                 }
06651                 // set status
06652                 if($name == 'Envelope'){
06653                         $this->status = 'envelope';
06654                 } elseif($name == 'Header' && $this->status = 'envelope'){
06655                         $this->root_header = $pos;
06656                         $this->status = 'header';
06657                 } elseif($name == 'Body' && $this->status = 'envelope'){
06658                         $this->status = 'body';
06659                         $this->body_position = $pos;
06660                 // set method
06661                 } elseif($this->status == 'body' && $pos == ($this->body_position+1)){
06662                         $this->status = 'method';
06663                         $this->root_struct_name = $name;
06664                         $this->root_struct = $pos;
06665                         $this->message[$pos]['type'] = 'struct';
06666                         $this->debug("found root struct $this->root_struct_name, pos $this->root_struct");
06667                 }
06668                 // set my status
06669                 $this->message[$pos]['status'] = $this->status;
06670                 // set name
06671                 $this->message[$pos]['name'] = htmlspecialchars($name);
06672                 // set attrs
06673                 $this->message[$pos]['attrs'] = $attrs;
06674 
06675                 // loop through atts, logging ns and type declarations
06676         $attstr = '';
06677                 foreach($attrs as $key => $value){
06678                 $key_prefix = $this->getPrefix($key);
06679                         $key_localpart = $this->getLocalPart($key);
06680                         // if ns declarations, add to class level array of valid namespaces
06681             if($key_prefix == 'xmlns'){
06682                                 if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
06683                                         $this->XMLSchemaVersion = $value;
06684                                         $this->namespaces['xsd'] = $this->XMLSchemaVersion;
06685                                         $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
06686                                 }
06687                 $this->namespaces[$key_localpart] = $value;
06688                                 // set method namespace
06689                                 if($name == $this->root_struct_name){
06690                                         $this->methodNamespace = $value;
06691                                 }
06692                         // if it's a type declaration, set type
06693         } elseif($key_localpart == 'type'){
06694                         if (isset($this->message[$pos]['type']) && $this->message[$pos]['type'] == 'array') {
06695                                 // do nothing: already processed arrayType
06696                         } else {
06697                         $value_prefix = $this->getPrefix($value);
06698                         $value_localpart = $this->getLocalPart($value);
06699                                         $this->message[$pos]['type'] = $value_localpart;
06700                                         $this->message[$pos]['typePrefix'] = $value_prefix;
06701                         if(isset($this->namespaces[$value_prefix])){
06702                                 $this->message[$pos]['type_namespace'] = $this->namespaces[$value_prefix];
06703                         } else if(isset($attrs['xmlns:'.$value_prefix])) {
06704                                                 $this->message[$pos]['type_namespace'] = $attrs['xmlns:'.$value_prefix];
06705                         }
06706                                         // should do something here with the namespace of specified type?
06707                                 }
06708                         } elseif($key_localpart == 'arrayType'){
06709                                 $this->message[$pos]['type'] = 'array';
06710                                 /* do arrayType ereg here
06711                                 [1]    arrayTypeValue    ::=    atype asize
06712                                 [2]    atype    ::=    QName rank*
06713                                 [3]    rank    ::=    '[' (',')* ']'
06714                                 [4]    asize    ::=    '[' length~ ']'
06715                                 [5]    length    ::=    nextDimension* Digit+
06716                                 [6]    nextDimension    ::=    Digit+ ','
06717                                 */
06718                                 $expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
06719                                 if(ereg($expr,$value,$regs)){
06720                                         $this->message[$pos]['typePrefix'] = $regs[1];
06721                                         $this->message[$pos]['arrayTypePrefix'] = $regs[1];
06722                         if (isset($this->namespaces[$regs[1]])) {
06723                                 $this->message[$pos]['arrayTypeNamespace'] = $this->namespaces[$regs[1]];
06724                         } else if (isset($attrs['xmlns:'.$regs[1]])) {
06725                                                 $this->message[$pos]['arrayTypeNamespace'] = $attrs['xmlns:'.$regs[1]];
06726                         }
06727                                         $this->message[$pos]['arrayType'] = $regs[2];
06728                                         $this->message[$pos]['arraySize'] = $regs[3];
06729                                         $this->message[$pos]['arrayCols'] = $regs[4];
06730                                 }
06731                         // specifies nil value (or not)
06732                         } elseif ($key_localpart == 'nil'){
06733                                 $this->message[$pos]['nil'] = ($value == 'true' || $value == '1');
06734                         // some other attribute
06735                         } elseif ($key != 'href' && $key != 'xmlns' && $key_localpart != 'encodingStyle' && $key_localpart != 'root') {
06736                                 $this->message[$pos]['xattrs']['!' . $key] = $value;
06737                         }
06738 
06739                         if ($key == 'xmlns') {
06740                                 $this->default_namespace = $value;
06741                         }
06742                         // log id
06743                         if($key == 'id'){
06744                                 $this->ids[$value] = $pos;
06745                         }
06746                         // root
06747                         if($key_localpart == 'root' && $value == 1){
06748                                 $this->status = 'method';
06749                                 $this->root_struct_name = $name;
06750                                 $this->root_struct = $pos;
06751                                 $this->debug("found root struct $this->root_struct_name, pos $pos");
06752                         }
06753             // for doclit
06754             $attstr .= " $key=\"$value\"";
06755                 }
06756         // get namespace - must be done after namespace atts are processed
06757                 if(isset($prefix)){
06758                         $this->message[$pos]['namespace'] = $this->namespaces[$prefix];
06759                         $this->default_namespace = $this->namespaces[$prefix];
06760                 } else {
06761                         $this->message[$pos]['namespace'] = $this->default_namespace;
06762                 }
06763         if($this->status == 'header'){
06764                 if ($this->root_header != $pos) {
06765                         $this->responseHeaders .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>";
06766                 }
06767         } elseif($this->root_struct_name != ''){
06768                 $this->document .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>";
06769         }
06770         }

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

nusoap_parser::start_element ( parser,
name,
attrs 
)

start-element handler

Parameter:
resource $parser XML parser object
string $name element name
array $attrs associative array of attributes private

Definiert in Zeile 152 der Datei class.soap_parser.php.

00152                                                        {
00153                 // position in a total number of elements, starting from 0
00154                 // update class level pos
00155                 $pos = $this->position++;
00156                 // and set mine
00157                 $this->message[$pos] = array('pos' => $pos,'children'=>'','cdata'=>'');
00158                 // depth = how many levels removed from root?
00159                 // set mine as current global depth and increment global depth value
00160                 $this->message[$pos]['depth'] = $this->depth++;
00161 
00162                 // else add self as child to whoever the current parent is
00163                 if($pos != 0){
00164                         $this->message[$this->parent]['children'] .= '|'.$pos;
00165                 }
00166                 // set my parent
00167                 $this->message[$pos]['parent'] = $this->parent;
00168                 // set self as current parent
00169                 $this->parent = $pos;
00170                 // set self as current value for this depth
00171                 $this->depth_array[$this->depth] = $pos;
00172                 // get element prefix
00173                 if(strpos($name,':')){
00174                         // get ns prefix
00175                         $prefix = substr($name,0,strpos($name,':'));
00176                         // get unqualified name
00177                         $name = substr(strstr($name,':'),1);
00178                 }
00179                 // set status
00180                 if($name == 'Envelope'){
00181                         $this->status = 'envelope';
00182                 } elseif($name == 'Header' && $this->status = 'envelope'){
00183                         $this->root_header = $pos;
00184                         $this->status = 'header';
00185                 } elseif($name == 'Body' && $this->status = 'envelope'){
00186                         $this->status = 'body';
00187                         $this->body_position = $pos;
00188                 // set method
00189                 } elseif($this->status == 'body' && $pos == ($this->body_position+1)){
00190                         $this->status = 'method';
00191                         $this->root_struct_name = $name;
00192                         $this->root_struct = $pos;
00193                         $this->message[$pos]['type'] = 'struct';
00194                         $this->debug("found root struct $this->root_struct_name, pos $this->root_struct");
00195                 }
00196                 // set my status
00197                 $this->message[$pos]['status'] = $this->status;
00198                 // set name
00199                 $this->message[$pos]['name'] = htmlspecialchars($name);
00200                 // set attrs
00201                 $this->message[$pos]['attrs'] = $attrs;
00202 
00203                 // loop through atts, logging ns and type declarations
00204         $attstr = '';
00205                 foreach($attrs as $key => $value){
00206                 $key_prefix = $this->getPrefix($key);
00207                         $key_localpart = $this->getLocalPart($key);
00208                         // if ns declarations, add to class level array of valid namespaces
00209             if($key_prefix == 'xmlns'){
00210                                 if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
00211                                         $this->XMLSchemaVersion = $value;
00212                                         $this->namespaces['xsd'] = $this->XMLSchemaVersion;
00213                                         $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
00214                                 }
00215                 $this->namespaces[$key_localpart] = $value;
00216                                 // set method namespace
00217                                 if($name == $this->root_struct_name){
00218                                         $this->methodNamespace = $value;
00219                                 }
00220                         // if it's a type declaration, set type
00221         } elseif($key_localpart == 'type'){
00222                         if (isset($this->message[$pos]['type']) && $this->message[$pos]['type'] == 'array') {
00223                                 // do nothing: already processed arrayType
00224                         } else {
00225                         $value_prefix = $this->getPrefix($value);
00226                         $value_localpart = $this->getLocalPart($value);
00227                                         $this->message[$pos]['type'] = $value_localpart;
00228                                         $this->message[$pos]['typePrefix'] = $value_prefix;
00229                         if(isset($this->namespaces[$value_prefix])){
00230                                 $this->message[$pos]['type_namespace'] = $this->namespaces[$value_prefix];
00231                         } else if(isset($attrs['xmlns:'.$value_prefix])) {
00232                                                 $this->message[$pos]['type_namespace'] = $attrs['xmlns:'.$value_prefix];
00233                         }
00234                                         // should do something here with the namespace of specified type?
00235                                 }
00236                         } elseif($key_localpart == 'arrayType'){
00237                                 $this->message[$pos]['type'] = 'array';
00238                                 /* do arrayType ereg here
00239                                 [1]    arrayTypeValue    ::=    atype asize
00240                                 [2]    atype    ::=    QName rank*
00241                                 [3]    rank    ::=    '[' (',')* ']'
00242                                 [4]    asize    ::=    '[' length~ ']'
00243                                 [5]    length    ::=    nextDimension* Digit+
00244                                 [6]    nextDimension    ::=    Digit+ ','
00245                                 */
00246                                 $expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
00247                                 if(ereg($expr,$value,$regs)){
00248                                         $this->message[$pos]['typePrefix'] = $regs[1];
00249                                         $this->message[$pos]['arrayTypePrefix'] = $regs[1];
00250                         if (isset($this->namespaces[$regs[1]])) {
00251                                 $this->message[$pos]['arrayTypeNamespace'] = $this->namespaces[$regs[1]];
00252                         } else if (isset($attrs['xmlns:'.$regs[1]])) {
00253                                                 $this->message[$pos]['arrayTypeNamespace'] = $attrs['xmlns:'.$regs[1]];
00254                         }
00255                                         $this->message[$pos]['arrayType'] = $regs[2];
00256                                         $this->message[$pos]['arraySize'] = $regs[3];
00257                                         $this->message[$pos]['arrayCols'] = $regs[4];
00258                                 }
00259                         // specifies nil value (or not)
00260                         } elseif ($key_localpart == 'nil'){
00261                                 $this->message[$pos]['nil'] = ($value == 'true' || $value == '1');
00262                         // some other attribute
00263                         } elseif ($key != 'href' && $key != 'xmlns' && $key_localpart != 'encodingStyle' && $key_localpart != 'root') {
00264                                 $this->message[$pos]['xattrs']['!' . $key] = $value;
00265                         }
00266 
00267                         if ($key == 'xmlns') {
00268                                 $this->default_namespace = $value;
00269                         }
00270                         // log id
00271                         if($key == 'id'){
00272                                 $this->ids[$value] = $pos;
00273                         }
00274                         // root
00275                         if($key_localpart == 'root' && $value == 1){
00276                                 $this->status = 'method';
00277                                 $this->root_struct_name = $name;
00278                                 $this->root_struct = $pos;
00279                                 $this->debug("found root struct $this->root_struct_name, pos $pos");
00280                         }
00281             // for doclit
00282             $attstr .= " $key=\"$value\"";
00283                 }
00284         // get namespace - must be done after namespace atts are processed
00285                 if(isset($prefix)){
00286                         $this->message[$pos]['namespace'] = $this->namespaces[$prefix];
00287                         $this->default_namespace = $this->namespaces[$prefix];
00288                 } else {
00289                         $this->message[$pos]['namespace'] = $this->default_namespace;
00290                 }
00291         if($this->status == 'header'){
00292                 if ($this->root_header != $pos) {
00293                         $this->responseHeaders .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>";
00294                 }
00295         } elseif($this->root_struct_name != ''){
00296                 $this->document .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>";
00297         }
00298         }

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


Dokumentation der Datenelemente

nusoap_parser::$body_position = 0

Definiert in Zeile 42 der Datei class.soap_parser.php.

nusoap_parser::$debug_flag = true

Definiert in Zeile 38 der Datei class.soap_parser.php.

nusoap_parser::$decode_utf8 = true

Definiert in Zeile 49 der Datei class.soap_parser.php.

nusoap_parser::$default_namespace = ''

Definiert in Zeile 29 der Datei class.soap_parser.php.

nusoap_parser::$depth = 0

Definiert in Zeile 28 der Datei class.soap_parser.php.

nusoap_parser::$depth_array = array()

Definiert in Zeile 37 der Datei class.soap_parser.php.

nusoap_parser::$document = ''

Definiert in Zeile 24 der Datei class.soap_parser.php.

nusoap_parser::$fault = false

Definiert in Zeile 33 der Datei class.soap_parser.php.

nusoap_parser::$fault_code = ''

Definiert in Zeile 34 der Datei class.soap_parser.php.

nusoap_parser::$fault_detail = ''

Definiert in Zeile 36 der Datei class.soap_parser.php.

nusoap_parser::$fault_str = ''

Definiert in Zeile 35 der Datei class.soap_parser.php.

nusoap_parser::$ids = array()

Definiert in Zeile 45 der Datei class.soap_parser.php.

nusoap_parser::$message = array()

Definiert in Zeile 31 der Datei class.soap_parser.php.

nusoap_parser::$method = ''

Definiert in Zeile 19 der Datei class.soap_parser.php.

nusoap_parser::$multirefs = array()

Definiert in Zeile 47 der Datei class.soap_parser.php.

nusoap_parser::$namespaces = array()

Erneute Implementation von nusoap_base.

Definiert in Zeile 30 der Datei class.soap_parser.php.

nusoap_parser::$parent = ''

Definiert in Zeile 32 der Datei class.soap_parser.php.

nusoap_parser::$position = 0

Definiert in Zeile 27 der Datei class.soap_parser.php.

nusoap_parser::$responseHeaders = ''

Definiert in Zeile 41 der Datei class.soap_parser.php.

nusoap_parser::$root_header = ''

Definiert in Zeile 23 der Datei class.soap_parser.php.

nusoap_parser::$root_struct = ''

Definiert in Zeile 20 der Datei class.soap_parser.php.

nusoap_parser::$root_struct_name = ''

Definiert in Zeile 21 der Datei class.soap_parser.php.

nusoap_parser::$root_struct_namespace = ''

Definiert in Zeile 22 der Datei class.soap_parser.php.

nusoap_parser::$soapheader = NULL

Definiert in Zeile 40 der Datei class.soap_parser.php.

nusoap_parser::$soapresponse = NULL

Definiert in Zeile 39 der Datei class.soap_parser.php.

nusoap_parser::$status = ''

Definiert in Zeile 26 der Datei class.soap_parser.php.

nusoap_parser::$xml = ''

Definiert in Zeile 17 der Datei class.soap_parser.php.

nusoap_parser::$xml_encoding = ''

Definiert in Zeile 18 der Datei class.soap_parser.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