Documentation

nusoap_parser extends nusoap_base
in package

nusoap_parser class parses SOAP XML messages into native PHP values

Tags
author

Dietrich Ayala dietrich@ganx4.com

author

Scott Nichol snichol@users.sourceforge.net

access

public

Table of Contents

$body_position  : mixed
$charencoding  : bool
toggles automatic encoding of special characters as entities (should always be true, I think)
$debug_flag  : mixed
$debug_str  : string
Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment)
$debugLevel  : int
the debug level for this instance
$decode_utf8  : mixed
$default_namespace  : mixed
$depth  : mixed
$depth_array  : mixed
$document  : mixed
$error_str  : string
Current error string (manipulated by getError/setError)
$fault  : mixed
$fault_code  : mixed
$fault_detail  : mixed
$fault_str  : mixed
$ids  : mixed
$message  : mixed
$method  : mixed
$multirefs  : mixed
$namespaces  : array<string|int, mixed>
namespaces in an array of prefix => uri
$parent  : mixed
$position  : mixed
$responseHeaders  : mixed
$revision  : string
CVS revision for HTTP headers.
$root_header  : mixed
$root_struct  : mixed
$root_struct_name  : mixed
$root_struct_namespace  : mixed
$soap_defencoding  : string
charset encoding for outgoing messages
$soapheader  : mixed
$soapresponse  : mixed
$status  : mixed
$title  : string
Identification for HTTP headers.
$typemap  : array<string|int, mixed>
XML Schema types in an array of uri => (array of xml type => php type) is this legacy yet? no, this is used by the nusoap_xmlschema class to verify type => namespace mappings.
$usedNamespaces  : array<string|int, mixed>
namespaces used in the current context, e.g. during serialization
$version  : string
Version for HTTP headers.
$xml  : mixed
$xml_encoding  : mixed
$xmlEntities  : array<string|int, mixed>
XML entities to convert
$XMLSchemaVersion  : string
set schema version
__construct()  : mixed
constructor that actually does the parsing
__toString()  : string
represents the object as a string
appendDebug()  : mixed
adds debug data to the instance debug string without formatting
buildVal()  : mixed
builds response structures for compound values (arrays/structs) and scalars
character_data()  : mixed
element content handler
clearDebug()  : mixed
clears the current debug data for this instance
contractQname()  : string
contracts (changes namespace to prefix) a qualified name
debug()  : mixed
adds debug data to the instance debug string with formatting
decodeSimple()  : mixed
decodes simple types into PHP variables
end_element()  : mixed
end-element handler
expandEntities()  : mixed
expands entities, e.g. changes '<' to '&lt;'.
expandQname()  : string
expands (changes prefix to namespace) a qualified name
formatDump()  : string
formats a string to be inserted into an HTML stream
get_response()  : mixed
get the parsed message (SOAP Body)
get_soapbody()  : mixed
get the parsed SOAP Body (null if there was none)
get_soapheader()  : mixed
get the parsed SOAP Header (null if there was none)
getDebug()  : debug
gets the current debug data for this instance
getDebugAsXMLComment()  : debug
gets the current debug data for this instance as an XML comment this may change the contents of the debug data
getDebugLevel()  : int
gets the debug level for this instance
getError()  : mixed
returns error string if present
getGlobalDebugLevel()  : int
gets the global debug level, which applies to future instances
getHeaders()  : string
get the unparsed SOAP Header
getLocalPart()  : string
returns the local part of a prefixed string returns the original string, if not prefixed
getmicrotime()  : string
returns the time in ODBC canonical form with microseconds
getNamespaceFromPrefix()  : mixed
pass it a prefix, it returns a namespace
getPrefix()  : mixed
returns the prefix part of a prefixed string returns false, if not prefixed
getPrefixFromNamespace()  : mixed
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace
isArraySimpleOrStruct()  : string
detect if array is a simple array or a struct (associative array)
serialize_val()  : string
serializes PHP values in accordance w/ section 5. Type information is not serialized if $use == 'literal'.
serializeEnvelope()  : string
serializes a message
setDebugLevel()  : mixed
sets the debug level for this instance
setError()  : bool
sets error string
setGlobalDebugLevel()  : mixed
sets the global debug level, which applies to future instances
start_element()  : mixed
start-element handler
varDump()  : string
Returns a string with the output of var_dump

Properties

$body_position

public mixed $body_position = 0

$charencoding

toggles automatic encoding of special characters as entities (should always be true, I think)

public bool $charencoding = rue
Tags
access

private

$debug_flag

public mixed $debug_flag = rue

$debug_str

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

public string $debug_str = ''
Tags
access

private

$debugLevel

the debug level for this instance

public int $debugLevel
Tags
access

private

$decode_utf8

public mixed $decode_utf8 = rue

$default_namespace

public mixed $default_namespace = ''

$depth

public mixed $depth = 0

$depth_array

public mixed $depth_array = array()

$document

public mixed $document = ''

$error_str

Current error string (manipulated by getError/setError)

public string $error_str = ''
Tags
access

private

$fault

public mixed $fault = alse

$fault_code

public mixed $fault_code = ''

$fault_detail

public mixed $fault_detail = ''

$fault_str

public mixed $fault_str = ''

$ids

public mixed $ids = array()

$message

public mixed $message = array()

$method

public mixed $method = ''

$multirefs

public mixed $multirefs = array()

$namespaces

namespaces in an array of prefix => uri

public array<string|int, mixed> $namespaces = array()

this is "seeded" by a set of constants, but it may be altered by code

$parent

public mixed $parent = ''

$position

public mixed $position = 0

$responseHeaders

public mixed $responseHeaders = ''

$revision

CVS revision for HTTP headers.

public string $revision = '$Revision: 1.123 $'
Tags
access

private

$root_header

public mixed $root_header = ''

$root_struct

public mixed $root_struct = ''

$root_struct_name

public mixed $root_struct_name = ''

$root_struct_namespace

public mixed $root_struct_namespace = ''

$soap_defencoding

charset encoding for outgoing messages

public string $soap_defencoding = 'ISO-8859-1'
Tags
access

public

$soapheader

public mixed $soapheader = ull

$soapresponse

public mixed $soapresponse = ull

$status

public mixed $status = ''

$title

Identification for HTTP headers.

public string $title = 'NuSOAP'
Tags
access

private

$typemap

XML Schema types in an array of uri => (array of xml type => php type) is this legacy yet? no, this is used by the nusoap_xmlschema class to verify type => namespace mappings.

public array<string|int, mixed> $typemap = 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', // abstract "any" types 'anyType' => 'string', 'anySimpleType' => 'string', // derived datatypes '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'))
Tags
access

public

$usedNamespaces

namespaces used in the current context, e.g. during serialization

public array<string|int, mixed> $usedNamespaces = array()
Tags
access

private

$version

Version for HTTP headers.

public string $version = '0.9.5'
Tags
access

private

$xml_encoding

public mixed $xml_encoding = ''

$xmlEntities

XML entities to convert

public array<string|int, mixed> $xmlEntities = array('quot' => '"', 'amp' => '&', 'lt' => '<', 'gt' => '>', 'apos' => "'")
Tags
access

public

deprecated
see
expandEntities

$XMLSchemaVersion

set schema version

public string $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'
Tags
access

public

Methods

__construct()

constructor that actually does the parsing

public __construct(string $xml[, string $encoding = 'UTF-8' ][, string $method = '' ][, string $decode_utf8 = true ]) : mixed
Parameters
$xml : string

SOAP message

$encoding : string = 'UTF-8'

character encoding scheme of message

$method : string = ''

method for which XML is parsed (unused?)

$decode_utf8 : string = true

whether to decode UTF-8 to ISO-8859-1

Tags
access

public

Return values
mixed

__toString()

represents the object as a string

public __toString() : string
Tags
access

public

Return values
string

appendDebug()

adds debug data to the instance debug string without formatting

public appendDebug(string $string) : mixed
Parameters
$string : string

debug data

Tags
access

public

Return values
mixed

buildVal()

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

public buildVal(int $pos) : mixed
Parameters
$pos : int

position in node tree

Tags
access

private

Return values
mixed

PHP value

character_data()

element content handler

public character_data(resource $parser, string $data) : mixed
Parameters
$parser : resource

XML parser object

$data : string

element content

Tags
access

private

Return values
mixed

clearDebug()

clears the current debug data for this instance

public clearDebug() : mixed
Tags
access

public

Return values
mixed

contractQname()

contracts (changes namespace to prefix) a qualified name

public contractQname(string $qname) : string
Parameters
$qname : string

qname

Tags
access

private

Return values
string

contracted qname

debug()

adds debug data to the instance debug string with formatting

public debug(string $string) : mixed
Parameters
$string : string

debug data

Tags
access

private

Return values
mixed

decodeSimple()

decodes simple types into PHP variables

public decodeSimple(string $value, string $type, string $typens) : mixed
Parameters
$value : string

value to decode

$type : string

XML type to decode

$typens : string

XML type namespace to decode

Tags
access

private

Return values
mixed

PHP value

end_element()

end-element handler

public end_element(resource $parser, string $name) : mixed
Parameters
$parser : resource

XML parser object

$name : string

element name

Tags
access

private

Return values
mixed

expandEntities()

expands entities, e.g. changes '<' to '&lt;'.

public expandEntities(string $val) : mixed
Parameters
$val : string

The string in which to expand entities.

Tags
access

private

Return values
mixed

expandQname()

expands (changes prefix to namespace) a qualified name

public expandQname(string $qname) : string
Parameters
$qname : string

qname

Tags
access

private

Return values
string

expanded qname

formatDump()

formats a string to be inserted into an HTML stream

public formatDump(string $str) : string
Parameters
$str : string

The string to format

Tags
access

public

deprecated
Return values
string

The formatted string

get_response()

get the parsed message (SOAP Body)

public get_response() : mixed
Tags
access

public

deprecated

use get_soapbody instead

Return values
mixed

get_soapbody()

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

public get_soapbody() : mixed
Tags
access

public

Return values
mixed

get_soapheader()

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

public get_soapheader() : mixed
Tags
access

public

Return values
mixed

getDebug()

gets the current debug data for this instance

public getDebug() : debug
Tags
access

public

Return values
debug

data

getDebugAsXMLComment()

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

public getDebugAsXMLComment() : debug
Tags
access

public

Return values
debug

data as an XML comment

getDebugLevel()

gets the debug level for this instance

public getDebugLevel() : int
Tags
access

public

Return values
int

Debug level 0-9, where 0 turns off

getError()

returns error string if present

public getError() : mixed
Tags
access

public

Return values
mixed

error string or false

getGlobalDebugLevel()

gets the global debug level, which applies to future instances

public getGlobalDebugLevel() : int
Tags
access

public

Return values
int

Debug level 0-9, where 0 turns off

getHeaders()

get the unparsed SOAP Header

public getHeaders() : string
Tags
access

public

Return values
string

XML or empty if no Header

getLocalPart()

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

public getLocalPart(string $str) : string
Parameters
$str : string

The prefixed string

Tags
access

public

Return values
string

The local part

getmicrotime()

returns the time in ODBC canonical form with microseconds

public getmicrotime() : string
Tags
access

public

Return values
string

The time in ODBC canonical form with microseconds

getNamespaceFromPrefix()

pass it a prefix, it returns a namespace

public getNamespaceFromPrefix(string $prefix) : mixed
Parameters
$prefix : string

The prefix

Tags
access

public

Return values
mixed

The namespace, false if no namespace has the specified prefix

getPrefix()

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

public getPrefix(string $str) : mixed
Parameters
$str : string

The prefixed string

Tags
access

public

Return values
mixed

The prefix or false if there is no prefix

getPrefixFromNamespace()

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

public getPrefixFromNamespace(string $ns) : mixed
Parameters
$ns : string

The namespace

Tags
access

public

Return values
mixed

The prefix, false if the namespace has no prefixes

isArraySimpleOrStruct()

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

public isArraySimpleOrStruct(mixed $val) : string
Parameters
$val : mixed

The PHP array

Tags
access

private

Return values
string

(arraySimple|arrayStruct)

serialize_val()

serializes PHP values in accordance w/ section 5. Type information is not serialized if $use == 'literal'.

public serialize_val(mixed $val[, string $name = false ][, string $type = false ][, string $name_ns = false ][, string $type_ns = false ][, array<string|int, mixed> $attributes = false ][, string $use = 'encoded' ][, bool $soapval = false ]) : string
Parameters
$val : mixed

The value to serialize

$name : string = false

The name (local part) of the XML element

$type : string = false

The XML schema type (local part) for the element

$name_ns : string = false

The namespace for the name of the XML element

$type_ns : string = false

The namespace for the type of the element

$attributes : array<string|int, mixed> = false

The attributes to serialize as name=>value pairs

$use : string = 'encoded'

The WSDL "use" (encoded|literal)

$soapval : bool = false

Whether this is called from soapval.

Tags
access

public

Return values
string

The serialized element, possibly with child elements

serializeEnvelope()

serializes a message

public serializeEnvelope(string $body[, mixed $headers = false ][, array<string|int, mixed> $namespaces = array() ][, string $style = 'rpc' ][, string $use = 'encoded' ][, string $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/' ]) : string
Parameters
$body : string

the XML of the SOAP body

$headers : mixed = false

optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array

$namespaces : array<string|int, mixed> = array()

optional the namespaces used in generating the body and headers

$style : string = 'rpc'

optional (rpc|document)

$use : string = 'encoded'

optional (encoded|literal)

$encodingStyle : string = 'http://schemas.xmlsoap.org/soap/encoding/'

optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)

Tags
access

public

Return values
string

the message

setDebugLevel()

sets the debug level for this instance

public setDebugLevel(int $level) : mixed
Parameters
$level : int

Debug level 0-9, where 0 turns off

Tags
access

public

Return values
mixed

setError()

sets error string

public setError(mixed $str) : bool
Parameters
$str : mixed
Tags
access

private

Return values
bool

$string error string

setGlobalDebugLevel()

sets the global debug level, which applies to future instances

public setGlobalDebugLevel(int $level) : mixed
Parameters
$level : int

Debug level 0-9, where 0 turns off

Tags
access

public

Return values
mixed

start_element()

start-element handler

public start_element(resource $parser, string $name, array<string|int, mixed> $attrs) : mixed
Parameters
$parser : resource

XML parser object

$name : string

element name

$attrs : array<string|int, mixed>

associative array of attributes

Tags
access

private

Return values
mixed

varDump()

Returns a string with the output of var_dump

public varDump(mixed $data) : string
Parameters
$data : mixed

The variable to var_dump

Tags
access

public

Return values
string

The output of var_dump

Search results