Packageindex Classtrees Modulegroups Elementlist Report XML Files

nusoap_base

nusoap_base

public class nusoap_base

nusoap_base

AuthorsDietrich Ayala <dietricha@ganx4.com>
Versionv 0.6

 
Direct known subclasses: soapmsg, soap_parser, soap_server, XMLSchema, soapclient, soap_fault, soap_transport_http, soapval

Public Method Summary

void nusoap_base()
constructor: loads schema version and namespace array
boolean getError()
returns error string if present
string serialize_val( $val, boolean $name, boolean $type, boolean $name_ns, boolean $type_ns, boolean $attributes)
serializes PHP values in accordance w/ section 5
string serializeEnvelope(string $body, [ boolean $headers, array $namespaces ])
serialize message
void soapclient(string $endpoint, [ string $wsdl, string $portName ])
constructor
mixed call(string $operation, [ array $params, string $namespace, string $soapAction, boolean $headers ])
calls method, returns PHP native type
array getOperationData(string $operation, [ string $bindingType ])
returns an associative array of data necessary for calling an operation
string send(string $data, [ integer $timeout ])
send the SOAP message via HTTP 1.0
object SOAPx4 parseResponse(string $data)
processes SOAP message returned from server
void setHeaders(string $headers)
set the SOAP headers
mixed getHeaders()
get the parsed headers
void setHTTPProxy(string $proxyhost, string $proxyport)
set proxy info here
void setCredentials(string $user, string $pass)
if authenticating, set user credentials here
object soap_proxy getProxy()
dynamically creates proxy class, allowing user to directly call methods from wsdl
void soapval([ string $name, boolean $type, mixed $value, boolean $element_ns, boolean $type_ns, boolean $attributes ])
constructor
void serialize()
serialize a fault
mixed decode()
decodes a soapval object into a PHP native type
void soap_parser(string $xml, [ string $encoding ], string $method)
constructor
object SOAPx4 get_response()
get the parsed message
void setSOAPAction(string $soapaction)
set the soapaction value
void setProxy(string $proxyhost, string $proxyport)
set proxy info here
string sendHTTPS(string $data, [ integer $timeout ])
send the SOAP message via HTTPS 1.0 using CURL
void soap_server([ boolean $wsdl ])
constructor
void service(string $data)
processes request and returns response
void add_to_map(string $methodname, string $in, string $out)
add a method to the dispatch map
void register(string $name, [ boolean $in, boolean $out, boolean $namespace, boolean $soapaction, boolean $style ])
register a service with the server
void fault(string $faultcode, string $faultactor, [ string $faultstring, string $faultdetail ])
create a fault. this also acts as a flag to the server that a fault has occured.
void XMLSchema([ string $schema, string $xml ])
constructor
boolean parseFile(string $xml, string $type)
parse an XML file
void serializeSchema()
serialize the schema
mixed getPHPType(string $type, string $ns)
get the PHP type of a user defined type in the schema
string getLocalPart(string $str)
returns the local part of a prefixed string
mixed getPrefix(string $str)
returns the prefix part of a prefixed string
mixed getNamespaceFromPrefix(string $prefix)
pass it a prefix, it returns a namespace
mixed getPrefixFromNamespace(string $ns)
returns the prefix for a given namespace
mixed getTypeDef(string $type)
returns an array of information about a given type
mixed serializeTypeDef(string $type)
returns a sample serialization of a given type, or false if no type by the given name
string typeToForm(string $name, string $type)
returns HTML form elements that allow a user
void wsdl([ string $wsdl ])
constructor
array getOperations([ string $bindingType ])
returns an assoc array of operation names => operation data
string serializeType(string $name, string $type, mixed $value)
serializes a PHP value according a given type definition
void timestamp_to_iso8601(string $timestamp, boolean $utc)
convert unix timestamp to ISO 8601 compliant date string
void iso8601_to_timestamp(string $datestr)
convert ISO 8601 compliant date string to unix timestamp

Private Method Summary

void debug(string $string)
adds debug data to the class level debug string
boolean setError( $str)
sets error string
void start_element(string $parser, string $name, string $attrs)
start-element handler
void end_element(string $parser, string $name)
end-element handler
void character_data(string $parser, string $data)
element content handler
void decode_entities(string $text)
decodes entities
void buildVal(string $pos)
builds response structures for compound values (arrays/structs)
void buildSoapVal(string $pos)
for building SOAP header values
void soap_transport_http( $url)
constructor
object SOAPx4 parse_request([ string $data ])
parses request and posts response
boolean verify_method(object SOAPx4 $operation, $request)
takes the soapval object that was created by parsing the request
void webDescription()
prints html description of services
void configureWSDL(string $serviceName, string $namespace)
sets up wsdl object
void parseString(string $xml, string $type)
parse an XML string
void schemaStartElement(string $parser, string $name, string $attrs)
start-element handler
void schemaEndElement(string $parser, string $name)
end-element handler
void schemaCharacterData(string $parser, string $data)
element content handler
string expandQname(string $qname)
expands a qualified name
void xdebug(string $string)
adds debug data to the clas level debug string
void parseWSDL([ string $wsdl ])
parses the wsdl document
mixed serializeRPCParameters(string $operation, mixed $parameters)
serialize a PHP value according to a WSDL message definition
void soap_fault(string $faultcode, string $faultactor, [ string $faultstring, string $faultdetail ])
constructor
void formatDump( $str)
Warning: documentation is missing.
void lib_bwcheck()
Warning: documentation is missing.
void makeObj()
Warning: documentation is missing.
void b_writeIt()
Warning: documentation is missing.
void popup()
Warning: documentation is missing.
void popout()
Warning: documentation is missing.
void getBindingData( $binding)
Warning: documentation is missing.
void getMessageData( $operation, $portType, $msgType)
Warning: documentation is missing.

Public Field Summary

string $soap_defencoding
set default encoding
array $namespaces
load namespace uris into an array of uri => prefix
array $typemap
load types into typemap array
array $xmlEntities
entities to convert
string $fault
fault related variables

Private Field Summary

string $title

string $version

boolean $error_str

unknown $username

unknown $password

boolean $requestHeaders

boolean $responseHeaders

unknown $endpoint

unknown $portName

unknown $url

array $operations

string $headers

string $request

string $xml_encoding

string $result

unknown $faultcode

unknown $faultactor

unknown $faultstring

unknown $faultdetail

Included files Summary, Type: require_once

class.soap_transport_http.php Warning: documentation is missing.

Public Method Details

nusoap_base

public void nusoap_base()

  constructor: loads schema version and namespace array

Returns void


getError

public boolean getError()

  returns error string if present

Returns boolean $string

error string


serialize_val

public string serialize_val( $val, boolean $name, boolean $type, boolean $name_ns, boolean $type_ns, boolean $attributes)

  serializes PHP values in accordance w/ section 5

Parameter
$val
Warning: documentation is missing.
boolean $name
Warning: documentation is missing.
boolean $type
Warning: documentation is missing.
boolean $name_ns
Warning: documentation is missing.
boolean $type_ns
Warning: documentation is missing.
boolean $attributes
Warning: documentation is missing.
Returns string


serializeEnvelope

public string serializeEnvelope(string $body, [ boolean $headers, array $namespaces ])

  serialize message

Parameter
string $body
boolean $headers = >>false<<
array $namespaces = >>array()<<
Returns string

message


soapclient

public void soapclient(string $endpoint, [ string $wsdl, string $portName ])

  constructor

Parameter
string $endpoint
SOAP server or WSDL URL
string $wsdl = >>""<<
optional, set to true if using WSDL
string $portName = >>""<<
optional portName in WSDL document
Returns void


call

public mixed call(string $operation, [ array $params, string $namespace, string $soapAction, boolean $headers ])

  calls method, returns PHP native type

Parameter
string $operation
SOAP server URL or path
array $params = >>array()<<
array of parameters, can be associative or not
string $namespace = >>""<<
optional method namespace
string $soapAction = >>""<<
optional SOAPAction value
boolean $headers = >>false<<
optional array of soapval objects for headers
Returns mixed


getOperationData

public array getOperationData(string $operation, [ string $bindingType ])

  returns an associative array of data necessary for calling an operation

Parameter
string $operation
, name of operation
string $bindingType = >>"soap"<<
, type of binding eg: soap
Returns array


send

public string send(string $data, [ integer $timeout ])

  send the SOAP message via HTTP 1.0

Parameter
string $data
message data
integer $timeout = >>0<<
set timeout in seconds
Returns string

data


parseResponse

public object SOAPx4 parseResponse(string $data)

  processes SOAP message returned from server

Parameter
string $data
response data from server
Returns object SOAPx4

soapval object


setHeaders

public void setHeaders(string $headers)

  set the SOAP headers

Parameter
string $headers
Returns void


getHeaders

public mixed getHeaders()

  get the parsed headers

Returns mixed

object SOAPx4 soapval object or empty if no headers


setHTTPProxy

public void setHTTPProxy(string $proxyhost, string $proxyport)

  set proxy info here

Parameter
string $proxyhost
string $proxyport
Returns void


setCredentials

public void setCredentials(string $user, string $pass)

  if authenticating, set user credentials here

Parameter
string $user
string $pass
Returns void


getProxy

public object soap_proxy getProxy()

  dynamically creates proxy class, allowing user to directly call methods from wsdl

Returns object soap_proxy

object


soapval

public void soapval([ string $name, boolean $type, mixed $value, boolean $element_ns, boolean $type_ns, boolean $attributes ])

  constructor

Parameter
string $name = >>"noname"<<
optional value name
boolean $type = >>false<<
optional type name
mixed $value = >>-1<<
optional content of value
boolean $element_ns = >>false<<
optional namespace of value
boolean $type_ns = >>false<<
optional namespace of type
boolean $attributes = >>false<<
associative array of attributes to add to element serialization
Returns void


serialize

public void serialize()

  serialize a fault

Returns void


decode

public mixed decode()

  decodes a soapval object into a PHP native type

Returns mixed


soap_parser

public void soap_parser(string $xml, [ string $encoding ], string $method)

  constructor

Parameter
string $xml
SOAP message
string $encoding = >>"UTF-8"<<
character encoding scheme of message
string $method
Warning: documentation is missing.
Returns void


get_response

public object SOAPx4 get_response()

  get the parsed message

Returns object SOAPx4

soap_val object


setSOAPAction

public void setSOAPAction(string $soapaction)

  set the soapaction value

Parameter
string $soapaction
Returns void


setProxy

public void setProxy(string $proxyhost, string $proxyport)

  set proxy info here

Parameter
string $proxyhost
string $proxyport
Returns void


sendHTTPS

public string sendHTTPS(string $data, [ integer $timeout ])

  send the SOAP message via HTTPS 1.0 using CURL

Parameter
string $data
message data
integer $timeout = >>0<<
set timeout in seconds
Returns string

data


soap_server

public void soap_server([ boolean $wsdl ])

  constructor

Parameter
boolean $wsdl = >>false<<
path or URL to a WSDL file
Returns void


service

public void service(string $data)

  processes request and returns response

Parameter
string $data
usually is the value of $HTTP_RAW_POST_DATA
Returns void


add_to_map

public void add_to_map(string $methodname, string $in, string $out)

  add a method to the dispatch map

Parameter
string $methodname
string $in
array of input values
string $out
array of output values
Returns void


register

public void register(string $name, [ boolean $in, boolean $out, boolean $namespace, boolean $soapaction, boolean $style ])

  register a service with the server

Parameter
string $name
boolean $in = >>false<<
array of input values
boolean $out = >>false<<
array of output values
boolean $namespace = >>false<<
boolean $soapaction = >>false<<
boolean $style = >>false<<
(rpc|literal)
Returns void


fault

public void fault(string $faultcode, string $faultactor, [ string $faultstring, string $faultdetail ])

  create a fault. this also acts as a flag to the server that a fault has occured.

Parameter
string $faultcode
string $faultactor
string $faultstring = >>''<<
string $faultdetail = >>''<<
Returns void


XMLSchema

public void XMLSchema([ string $schema, string $xml ])

  constructor

Parameter
string $schema = >>""<<
schema document URI
string $xml = >>""<<
xml document URI
Returns void


parseFile

public boolean parseFile(string $xml, string $type)

  parse an XML file

Parameter
string $xml
, path/URL to XML file
string $type
, (schema | xml)
Returns boolean


serializeSchema

public void serializeSchema()

  serialize the schema

Returns void


getPHPType

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

  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'

Parameter
string $type
, name of defined type
string $ns
, namespace of type
Returns mixed


getLocalPart

public string getLocalPart(string $str)

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

Parameter
string $str
Returns string


getPrefix

public mixed getPrefix(string $str)

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

Parameter
string $str
Returns mixed


getNamespaceFromPrefix

public mixed getNamespaceFromPrefix(string $prefix)

  pass it a prefix, it returns a namespace or false if no prefixes registered for the given namespace

Parameter
string $prefix
Returns mixed


getPrefixFromNamespace

public mixed getPrefixFromNamespace(string $ns)

  returns the prefix for a given namespace returns false if no namespace registered with the given prefix

Parameter
string $ns
Returns mixed


getTypeDef

public mixed getTypeDef(string $type)

  returns an array of information about a given type returns false if no type exists by the given name typeDef = array( 'elements' => array(), // refs to elements array 'restrictionBase' => '', 'phpType' => '', 'order' => '(sequence|all)', 'attrs' => array() // refs to attributes array )

Parameter
string $type
Returns mixed


serializeTypeDef

public mixed serializeTypeDef(string $type)

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

Parameter
string $type
, name of type
Returns mixed


typeToForm

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

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

Parameter
string $name
, name for type instance
string $type
, name of type
Returns string


wsdl

public void wsdl([ string $wsdl ])

  constructor

Parameter
string $wsdl = >>""<<
WSDL document URL
Returns void


getOperations

public array getOperations([ string $bindingType ])

  returns an assoc array of operation names => operation data NOTE: currently only supports multiple services of differing binding types This method needs some work

Parameter
string $bindingType = >>"soap"<<
eg: soap, smtp, dime (only soap is currently supported)
Returns array


serializeType

public string serializeType(string $name, string $type, mixed $value)

  serializes a PHP value according a given type definition

Parameter
string $name
, name of type
string $type
, type of type, heh
mixed $value
, a native PHP value
Returns string

serialization


timestamp_to_iso8601

public void timestamp_to_iso8601(string $timestamp, boolean $utc)

  convert unix timestamp to ISO 8601 compliant date string

Parameter
string $timestamp
Unix time stamp
boolean $utc
Warning: documentation is missing.
Returns void


iso8601_to_timestamp

public void iso8601_to_timestamp(string $datestr)

  convert ISO 8601 compliant date string to unix timestamp

Parameter
string $datestr
ISO 8601 compliant date string
Returns void


Private Method Details

debug

private void debug(string $string)

  adds debug data to the class level debug string

Parameter
string $string
debug data
Returns void


setError

private boolean setError( $str)

  sets error string

Parameter
$str
Warning: documentation is missing.
Returns boolean $string

error string


start_element

private void start_element(string $parser, string $name, string $attrs)

  start-element handler

Parameter
string $parser
XML parser object
string $name
element name
string $attrs
associative array of attributes
Returns void


end_element

private void end_element(string $parser, string $name)

  end-element handler

Parameter
string $parser
XML parser object
string $name
element name
Returns void


character_data

private void character_data(string $parser, string $data)

  element content handler

Parameter
string $parser
XML parser object
string $data
element content
Returns void


decode_entities

private void decode_entities(string $text)

  decodes entities

Parameter
string $text
string to translate
Returns void


buildVal

private void buildVal(string $pos)

  builds response structures for compound values (arrays/structs)

Parameter
string $pos
position in node tree
Returns void


buildSoapVal

private void buildSoapVal(string $pos)

  for building SOAP header values

Parameter
string $pos
position in node tree
Returns void


soap_transport_http

private void soap_transport_http( $url)

  constructor

Parameter
$url
Warning: documentation is missing.
Returns void


parse_request

private object SOAPx4 parse_request([ string $data ])

  parses request and posts response

Parameter
string $data = >>""<<
XML string
Returns object SOAPx4

soapmsg object


verify_method

private boolean verify_method(object SOAPx4 $operation, $request)

  takes the soapval object that was created by parsing the request and compares to the method's signature, if available.

Parameter
object SOAPx4 $operation
soapval object
$request
Warning: documentation is missing.
Returns boolean


webDescription

private void webDescription()

  prints html description of services

Returns void


configureWSDL

private void configureWSDL(string $serviceName, string $namespace)

  sets up wsdl object this acts as a flag to enable internal WSDL generation NOTE: NOT FUNCTIONAL

Parameter
string $serviceName
, name of the service
string $namespace
, tns namespace
Returns void


parseString

private void parseString(string $xml, string $type)

  parse an XML string

Parameter
string $xml
path or URL
string $type
, (schema|xml)
Returns void


schemaStartElement

private void schemaStartElement(string $parser, string $name, string $attrs)

  start-element handler

Parameter
string $parser
XML parser object
string $name
element name
string $attrs
associative array of attributes
Returns void


schemaEndElement

private void schemaEndElement(string $parser, string $name)

  end-element handler

Parameter
string $parser
XML parser object
string $name
element name
Returns void


schemaCharacterData

private void schemaCharacterData(string $parser, string $data)

  element content handler

Parameter
string $parser
XML parser object
string $data
element content
Returns void


expandQname

private string expandQname(string $qname)

  expands a qualified name

Parameter
string $qname
qname
Returns string

expanded qname


xdebug

private void xdebug(string $string)

  adds debug data to the clas level debug string

Parameter
string $string
debug data
Returns void


parseWSDL

private void parseWSDL([ string $wsdl ])

  parses the wsdl document

Parameter
string $wsdl = >>""<<
path or URL
Returns void


serializeRPCParameters

private mixed serializeRPCParameters(string $operation, mixed $parameters)

  serialize a PHP value according to a WSDL message definition TODO - only serialize namespaces used in the message - multi-ref serialization - validate PHP values against type definitions, return errors if invalid - probably more stuff :) - implement 'out' functionality or write new function for 'out' parameters

Parameter
string $operation
name
mixed $parameters
value
Returns mixed

new param or false if initial value didn't validate


soap_fault

private void soap_fault(string $faultcode, string $faultactor, [ string $faultstring, string $faultdetail ])

  constructor

Parameter
string $faultcode
string $faultactor
(client | server)
string $faultstring = >>''<<
string $faultdetail = >>''<<
Returns void


formatDump

private void formatDump( $str)

 

Warning: documentation is missing.

Parameter
$str
Warning: documentation is missing.
Returns void


lib_bwcheck

private void lib_bwcheck()

 

Warning: documentation is missing.

Returns void


makeObj

private void makeObj()

 

Warning: documentation is missing.

Returns void


b_writeIt

private void b_writeIt()

 

Warning: documentation is missing.

Returns void


popup

private void popup()

 

Warning: documentation is missing.

Returns void


popout

private void popout()

 

Warning: documentation is missing.

Returns void


getBindingData

private void getBindingData( $binding)

 

Warning: documentation is missing.

Parameter
$binding
Warning: documentation is missing.
Returns void


getMessageData

private void getMessageData( $operation, $portType, $msgType)

 

Warning: documentation is missing.

Parameter
$operation
Warning: documentation is missing.
$portType
Warning: documentation is missing.
$msgType
Warning: documentation is missing.
Returns void


Public Field Details

$soap_defencoding

public string $soap_defencoding

>>'UTF-8'<<

set default encoding


$namespaces

public array $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/', 'si' => 'http://soapinterop.org/xsd')<<

load namespace uris into an array of uri => prefix


$typemap

public array $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', // derived datatypes 'normalizedString'=>'string','token'=>'string','language'=>'','NMTOKEN'=>'','NMTOKENS'=>'','Name'=>'','NCName'=>'','ID'=>'', 'IDREF'=>'','IDREFS'=>'','ENTITY'=>'','ENTITIES'=>'','integer'=>'integer','nonPositiveInteger'=>'integer', 'negativeInteger'=>'integer','long'=>'','int'=>'integer','short'=>'','byte'=>'','nonNegativeInteger'=>'integer', 'unsignedLong'=>'','unsignedInt'=>'','unsignedShort'=>'','unsignedByte'=>'','positiveInteger'=>''), 'http://www.w3.org/1999/XMLSchema' => array( 'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double', 'float'=>'double','dateTime'=>'string', 'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'), 'http://soapinterop.org/xsd' => array('SOAPStruct'=>'struct'), 'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string','array'=>'array','Array'=>'array') )<<

load types into typemap array is this legacy yet?


$xmlEntities

public array $xmlEntities

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

entities to convert


$fault

public string $fault

>><<

fault related variables


Private Field Details

$title

private string $title

>>'NuSOAP'<<


$version

private string $version

>>'0.6'<<


$error_str

private boolean $error_str

>>false<<


$username

private unknown $username

>><<


$password

private unknown $password

>><<


$requestHeaders

private boolean $requestHeaders

>>false<<


$responseHeaders

private boolean $responseHeaders

>>false<<


$endpoint

private unknown $endpoint

>><<


$portName

private unknown $portName

>><<


$url

private unknown $url

>><<


$operations

private array $operations

>>array()<<


$headers

private string $headers

>>""<<


$request

private string $request

>>""<<


$xml_encoding

private string $xml_encoding

>>"UTF-8"<<


$result

private string $result

>>"successful"<<


$faultcode

private unknown $faultcode

>><<


$faultactor

private unknown $faultactor

>><<


$faultstring

private unknown $faultstring

>><<


$faultdetail

private unknown $faultdetail

>><<


Included Files, Type: require_once

class.soap_transport_http.php

require_once( class.soap_transport_http.php )



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta