Documentation

XMLSchema extends nusoap_xmlschema
in package

Backward compatibility

Table of Contents

$attributes  : mixed
$charencoding  : bool
toggles automatic encoding of special characters as entities (should always be true, I think)
$complexTypes  : mixed
$complexTypeStack  : mixed
$currentComplexType  : mixed
$currentElement  : mixed
$currentSimpleType  : mixed
$debug_str  : string
Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment)
$debugLevel  : int
the debug level for this instance
$defaultNamespace  : mixed
$depth  : mixed
$depth_array  : mixed
$elements  : mixed
$elementStack  : mixed
$enclosingNamespaces  : mixed
$error_str  : string
Current error string (manipulated by getError/setError)
$imports  : mixed
$message  : mixed
$namespaces  : array<string|int, mixed>
namespaces in an array of prefix => uri
$parser  : mixed
$position  : mixed
$revision  : string
CVS revision for HTTP headers.
$schema  : mixed
$schemaInfo  : mixed
$schemaTargetNamespace  : mixed
$simpleTypes  : mixed
$simpleTypeStack  : mixed
$soap_defencoding  : string
charset encoding for outgoing messages
$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
$xmlEntities  : array<string|int, mixed>
XML entities to convert
$XMLSchemaVersion  : string
set schema version
__construct()  : mixed
constructor
__toString()  : string
represents the object as a string
addComplexType()  : mixed
adds a complex type to the schema
addElement()  : mixed
adds an element to the schema
addSimpleType()  : mixed
adds a simple type to the schema
appendDebug()  : mixed
adds debug data to the instance debug string without formatting
clearDebug()  : mixed
clears the current debug data for this instance
contractQname()  : string
contracts (changes namespace to prefix) a qualified name
CreateTypeName()  : string
gets a type name for an unnamed type
debug()  : mixed
adds debug data to the instance debug string with formatting
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
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
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
getPHPType()  : mixed
get the PHP type of a user defined type in the schema PHP type is kind of a misnomer since it actually returns 'struct' for assoc. arrays returns false if no type exists, or not w/ the given namespace else returns a string that is either a native php type, or 'struct'
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
getTypeDef()  : mixed
returns an associative array of information about a given type returns false if no type exists by the given name
isArraySimpleOrStruct()  : string
detect if array is a simple array or a struct (associative array)
parseFile()  : bool
parse an XML file
parseString()  : mixed
parse an XML string
schemaCharacterData()  : mixed
element content handler
schemaEndElement()  : mixed
end-element handler
schemaStartElement()  : mixed
start-element handler
serialize_val()  : string
serializes PHP values in accordance w/ section 5. Type information is not serialized if $use == 'literal'.
serializeEnvelope()  : string
serializes a message
serializeSchema()  : mixed
serialize the schema
serializeTypeDef()  : mixed
returns a sample serialization of a given type, or false if no type by the given name
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
typeToForm()  : string
returns HTML form elements that allow a user to enter values for creating an instance of the given type.
varDump()  : string
Returns a string with the output of var_dump
xdebug()  : mixed
adds debug data to the clas level debug string

Properties

$attributes

public mixed $attributes = array()

$charencoding

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

public bool $charencoding = rue
Tags
access

private

$complexTypes

public mixed $complexTypes = array()

$complexTypeStack

public mixed $complexTypeStack = array()

$currentComplexType

public mixed $currentComplexType = ull

$currentElement

public mixed $currentElement = ull

$currentSimpleType

public mixed $currentSimpleType = ull

$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

$defaultNamespace

public mixed $defaultNamespace = array()

$depth

public mixed $depth = 0

$depth_array

public mixed $depth_array = array()

$elements

public mixed $elements = array()

$elementStack

public mixed $elementStack = array()

$enclosingNamespaces

public mixed $enclosingNamespaces

$error_str

Current error string (manipulated by getError/setError)

public string $error_str = ''
Tags
access

private

$imports

public mixed $imports = array()

$message

public mixed $message = array()

$namespaces

namespaces in an array of prefix => uri

public array<string|int, mixed> $namespaces = array('SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/', 'xsd' => 'http://www.w3.org/2001/XMLSchema', 'xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/')

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

Tags
access

public

$position

public mixed $position = 0

$revision

CVS revision for HTTP headers.

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

private

$schema

public mixed $schema = ''

$schemaInfo

public mixed $schemaInfo = array()

$schemaTargetNamespace

public mixed $schemaTargetNamespace = ''

$simpleTypes

public mixed $simpleTypes = array()

$simpleTypeStack

public mixed $simpleTypeStack = array()

$soap_defencoding

charset encoding for outgoing messages

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

public

$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

$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

public __construct() : mixed
Tags
access

public

Return values
mixed

__toString()

represents the object as a string

public __toString() : string
Tags
access

public

Return values
string

addComplexType()

adds a complex type to the schema

public addComplexType(mixed $name[, mixed $typeClass = 'complexType' ][, mixed $phpType = 'array' ][, mixed $compositor = '' ][, mixed $restrictionBase = '' ][, mixed $elements = array() ][, mixed $attrs = array() ][, mixed $arrayType = '' ]) : mixed

example: array

addType( 'ArrayOfstring', 'complexType', 'array', '', 'SOAP-ENC:Array', array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'), 'xsd:string' );

example: PHP associative array ( SOAP Struct )

addType( 'SOAPStruct', 'complexType', 'struct', 'all', array('myVar'=> array('name'=>'myVar','type'=>'string') );

Parameters
$name : mixed
$typeClass : mixed = 'complexType'
$phpType : mixed = 'array'
$compositor : mixed = ''
$restrictionBase : mixed = ''
$elements : mixed = array()
$attrs : mixed = array()
$arrayType : mixed = ''
Tags
access

public

see
getTypeDef
Return values
mixed

addElement()

adds an element to the schema

public addElement(array<string|int, mixed> $attrs) : mixed
Parameters
$attrs : array<string|int, mixed>

attributes that must include name and type

Tags
see
nusoap_xmlschema
access

public

Return values
mixed

addSimpleType()

adds a simple type to the schema

public addSimpleType(string $name[, string $restrictionBase = '' ][, string $typeClass = 'simpleType' ][, string $phpType = 'scalar' ][, array<string|int, mixed> $enumeration = array() ]) : mixed
Parameters
$name : string
$restrictionBase : string = ''

namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)

$typeClass : string = 'simpleType'

(should always be simpleType)

$phpType : string = 'scalar'

(should always be scalar)

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

array of values

Tags
access

public

see
nusoap_xmlschema
see
getTypeDef
Return values
mixed

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

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

CreateTypeName()

gets a type name for an unnamed type

public CreateTypeName(mixed $ename) : string
Parameters
$ename : mixed
Tags
access

private

Return values
string

A type name for an unnamed type

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

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

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

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

getPHPType()

get the PHP type of a user defined type in the schema PHP type is kind of a misnomer since it actually returns 'struct' for assoc. arrays returns false if no type exists, or not w/ the given namespace else returns a string that is either a native php type, or 'struct'

public getPHPType(string $type, string $ns) : mixed
Parameters
$type : string

name of defined type

$ns : string

namespace of type

Tags
access

public

deprecated
Return values
mixed

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

getTypeDef()

returns an associative array of information about a given type returns false if no type exists by the given name

public getTypeDef(string $type) : mixed

For a complexType typeDef = array( 'restrictionBase' => '', 'phpType' => '', 'compositor' => '(sequence|all)', 'elements' => array(), // refs to elements array 'attrs' => array() // refs to attributes array ... and so on (see addComplexType) )

For simpleType or element, the array has different keys.

Parameters
$type : string
Tags
access

public

see
addComplexType
see
addSimpleType
see
addElement
Return values
mixed

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)

parseFile()

parse an XML file

public parseFile(string $xml, string $type) : bool
Parameters
$xml : string

path/URL to XML file

$type : string

(schema | xml)

Tags
access

public

Return values
bool

parseString()

parse an XML string

public parseString(string $xml, string $type) : mixed
Parameters
$xml : string

path or URL

$type : string

(schema|xml)

Tags
access

private

Return values
mixed

schemaCharacterData()

element content handler

public schemaCharacterData(string $parser, string $data) : mixed
Parameters
$parser : string

XML parser object

$data : string

element content

Tags
access

private

Return values
mixed

schemaEndElement()

end-element handler

public schemaEndElement(string $parser, string $name) : mixed
Parameters
$parser : string

XML parser object

$name : string

element name

Tags
access

private

Return values
mixed

schemaStartElement()

start-element handler

public schemaStartElement(string $parser, string $name, string $attrs) : mixed
Parameters
$parser : string

XML parser object

$name : string

element name

$attrs : string

associative array of attributes

Tags
access

private

Return values
mixed

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

serializeSchema()

serialize the schema

public serializeSchema() : mixed
Tags
access

public

Return values
mixed

serializeTypeDef()

returns a sample serialization of a given type, or false if no type by the given name

public serializeTypeDef(string $type) : mixed
Parameters
$type : string

name of type

Tags
access

public

deprecated
Return values
mixed

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

typeToForm()

returns HTML form elements that allow a user to enter values for creating an instance of the given type.

public typeToForm(string $name, string $type) : string
Parameters
$name : string

name for type instance

$type : string

name of type

Tags
access

public

deprecated
Return values
string

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

xdebug()

adds debug data to the clas level debug string

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

debug data

Tags
access

private

Return values
mixed

Search results