[ Index ]

Source Code Reference for V1.00

title

Body

[close]

/lib/phpgacl/soap/ -> nusoap.php (summary)

(no description)

File Size: 4098 lines (133 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 0 files

Defines 9 classes

nusoap_base:: (11 methods):
  debug()
  getError()
  setError()
  serialize_val()
  serializeEnvelope()
  formatDump()
  getLocalPart()
  getPrefix()
  varDump()
  timestamp_to_iso8601()
  iso8601_to_timestamp()

soap_fault:: (2 methods):
  soap_fault()
  serialize()

XMLSchema:: (18 methods):
  XMLSchema()
  parseFile()
  parseString()
  schemaStartElement()
  schemaEndElement()
  schemaCharacterData()
  serializeSchema()
  expandQname()
  xdebug()
  getPHPType()
  getLocalPart()
  getPrefix()
  getNamespaceFromPrefix()
  getPrefixFromNamespace()
  getTypeDef()
  serializeTypeDef()
  typeToForm()
  addComplexType()

soapval:: (3 methods):
  soapval()
  serialize()
  decode()

soap_transport_http:: (9 methods):
  soap_transport_http()
  connect()
  send()
  sendHTTPS()
  setCredentials()
  setSOAPAction()
  setEncoding()
  setProxy()
  decodeChunked()

soap_server:: (14 methods):
  soap_server()
  service()
  parse_request()
  verify_method()
  add_to_map()
  register()
  fault()
  webDescription()
  lib_bwcheck()
  makeObj()
  b_writeIt()
  popup()
  popout()
  configureWSDL()

wsdl:: (12 methods):
  wsdl()
  parseWSDL()
  start_element()
  end_element()
  character_data()
  getBindingData()
  getOperations()
  getOperationData()
  serialize()
  serializeRPCParameters()
  serializeType()
  addOperation()

soap_parser:: (8 methods):
  soap_parser()
  start_element()
  end_element()
  character_data()
  get_response()
  getHeaders()
  decode_entities()
  buildVal()

soapclient:: (14 methods):
  soapclient()
  call()
  getOperationData()
  send()
  parseResponse()
  setHeaders()
  getHeaders()
  setHTTPProxy()
  setCredentials()
  setHTTPEncoding()
  useHTTPPersistentConnection()
  getDefaultRpcParams()
  setDefaultRpcParams()
  getProxy()


Class: nusoap_base  - X-Ref

nusoap_base

debug($string)   X-Ref
adds debug data to the class level debug string

param: string $string debug data

getError()   X-Ref
returns error string if present

return: boolean $string error string

setError($str)   X-Ref
sets error string

return: boolean $string error string

serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=false,$attributes=false,$use='encoded')   X-Ref
serializes PHP values in accordance w/ section 5. Type information is
not serialized if $use == 'literal'.

return: string

serializeEnvelope($body,$headers=false,$namespaces=array()   X-Ref
serialize message

param: string body
param: string headers
param: array namespaces
param: string style
return: string message

formatDump($str)   X-Ref
No description

getLocalPart($str)   X-Ref
returns the local part of a prefixed string
returns the original string, if not prefixed

param: string
return: string

getPrefix($str)   X-Ref
returns the prefix part of a prefixed string
returns false, if not prefixed

param: string
return: mixed

varDump($data)   X-Ref
No description

timestamp_to_iso8601($timestamp,$utc=true)   X-Ref
convert unix timestamp to ISO 8601 compliant date string

param: string $timestamp Unix time stamp

iso8601_to_timestamp($datestr)   X-Ref
convert ISO 8601 compliant date string to unix timestamp

param: string $datestr ISO 8601 compliant date string

Class: soap_fault  - X-Ref

soap_fault class, allows for creation of faults
mainly used for returning faults from deployed functions
in a server instance.

soap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail='')   X-Ref
constructor

param: string $faultcode (client | server)
param: string $faultactor only used when msg routed between multiple actors
param: string $faultstring human readable error message
param: string $faultdetail

serialize()   X-Ref
serialize a fault


Class: XMLSchema  - X-Ref

parses an XML Schema, allows access to it's data, other utility methods
no validation... yet.
very experimental and limited. As is discussed on XML-DEV, I'm one of the people
that just doesn't have time to read the spec(s) thoroughly, and just have a couple of trusty
tutorials I refer to :)

XMLSchema($schema='',$xml='')   X-Ref
constructor

param: string $schema schema document URI
param: string $xml xml document URI

parseFile($xml,$type)   X-Ref
parse an XML file

param: string $xml, path/URL to XML file
param: string $type, (schema | xml)
return: boolean

parseString($xml,$type)   X-Ref
parse an XML string

param: string $xml path or URL
param: string $type, (schema|xml)

schemaStartElement($parser, $name, $attrs)   X-Ref
start-element handler

param: string $parser XML parser object
param: string $name element name
param: string $attrs associative array of attributes

schemaEndElement($parser, $name)   X-Ref
end-element handler

param: string $parser XML parser object
param: string $name element name

schemaCharacterData($parser, $data)   X-Ref
element content handler

param: string $parser XML parser object
param: string $data element content

serializeSchema()   X-Ref
serialize the schema


expandQname($qname)   X-Ref
expands a qualified name

param: string $string qname
return: string expanded qname

xdebug($string)   X-Ref
adds debug data to the clas level debug string

param: string $string debug data

getPHPType($type,$ns)   X-Ref
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'

param: string $type, name of defined type
param: string $ns, namespace of type
return: mixed

getLocalPart($str)   X-Ref
returns the local part of a prefixed string
returns the original string, if not prefixed

param: string
return: string

getPrefix($str)   X-Ref
returns the prefix part of a prefixed string
returns false, if not prefixed

param: string
return: mixed

getNamespaceFromPrefix($prefix)   X-Ref
pass it a prefix, it returns a namespace
returns false if no namespace registered with the given prefix

param: string
return: mixed

getPrefixFromNamespace($ns)   X-Ref
returns the prefix for a given namespace (or prefix)
or false if no prefixes registered for the given namespace

param: string
return: mixed

getTypeDef($type)   X-Ref
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
)

param: string
return: mixed

serializeTypeDef($type)   X-Ref
returns a sample serialization of a given type, or false if no type by the given name

param: string $type, name of type
return: mixed

typeToForm($name,$type)   X-Ref
returns HTML form elements that allow a user
to enter values for creating an instance of the given type.

param: string $name, name for type instance
param: string $type, name of type
return: string

addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array()   X-Ref
adds an XML Schema complex type to the WSDL types

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

param: name
param: typeClass (complexType|simpleType|attribute)
param: phpType: currently supported are array and struct (php assoc array)
param: compositor (all|sequence|choice)
param: restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
param: elements = array ( name = array(name=>'',type=>'') )
param: attrs = array(
param: arrayType: namespace:name (http://www.w3.org/2001/XMLSchema:string)

Class: soapval  - X-Ref

for creating serializable abstractions of native PHP types
NOTE: this is only really used when WSDL is not available.

soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false)   X-Ref
constructor

param: string $name optional name
param: string $type optional type name
param: mixed $value optional value
param: string $namespace optional namespace of value
param: string $type_namespace optional namespace of type
param: array $attributes associative array of attributes to add to element serialization

serialize($use='encoded')   X-Ref
return serialized value

return: string XML data

decode()   X-Ref
decodes a soapval object into a PHP native type

param: object $soapval optional SOAPx4 soapval object, else uses self
return: mixed

Class: soap_transport_http  - X-Ref

transport class for sending/receiving data via HTTP and HTTPS
NOTE: PHP must be compiled with the CURL extension for HTTPS support

soap_transport_http($url)   X-Ref
constructor


connect($timeout)   X-Ref
No description

send($data, $timeout=0)   X-Ref
send the SOAP message via HTTP

param: string $data message data
param: integer $timeout set timeout in seconds
return: string data

sendHTTPS($data, $timeout=0)   X-Ref
send the SOAP message via HTTPS 1.0 using CURL

param: string $msg message data
param: integer $timeout set timeout in seconds
return: string data

setCredentials($username, $password)   X-Ref
if authenticating, set user credentials here

param: string $user
param: string $pass

setSOAPAction($soapaction)   X-Ref
set the soapaction value

param: string $soapaction

setEncoding($enc='gzip, deflate')   X-Ref
use http encoding

param: string $enc encoding style. supported values: gzip, deflate, or both

setProxy($proxyhost, $proxyport)   X-Ref
set proxy info here

param: string $proxyhost
param: string $proxyport

decodeChunked($buffer)   X-Ref
decode a string that is encoded w/ "chunked' transfer encoding
as defined in RFC2068 19.4.6

returns: string
param: string $buffer

Class: soap_server  - X-Ref

soap_server allows the user to create a SOAP server
that is capable of receiving messages and returning responses

NOTE: WSDL functionality is experimental

soap_server($wsdl=false)   X-Ref
constructor
the optional parameter is a path to a WSDL file that you'd like to bind the server instance to.

param: string $wsdl path or URL to a WSDL file

service($data)   X-Ref
processes request and returns response

param: string $data usually is the value of $HTTP_RAW_POST_DATA

parse_request($data='')   X-Ref
parses request and posts response

param: string $data XML string
return: string XML response msg

verify_method($operation,$request)   X-Ref
takes the value that was created by parsing the request
and compares to the method's signature, if available.

param: mixed
return: boolean

add_to_map($methodname,$in,$out)   X-Ref
add a method to the dispatch map

param: string $methodname
param: string $in array of input values
param: string $out array of output values

register($name,$in=false,$out=false,$namespace=false,$soapaction=false,$style=false,$use=false)   X-Ref
register a service with the server

param: string $methodname
param: string $in assoc array of input values: key = param name, value = param type
param: string $out assoc array of output values: key = param name, value = param type
param: string $namespace
param: string $soapaction
param: string $style (rpc|literal)

fault($faultcode,$faultactor,$faultstring='',$faultdetail='')   X-Ref
create a fault. this also acts as a flag to the server that a fault has occured.

param: string faultcode
param: string faultactor
param: string faultstring
param: string faultdetail

webDescription()   X-Ref
prints html description of services


lib_bwcheck()   X-Ref
No description

makeObj(obj)   X-Ref
No description

b_writeIt(text)   X-Ref
No description

popup(divid)   X-Ref
No description

popout()   X-Ref
No description

configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http:)   X-Ref
sets up wsdl object
this acts as a flag to enable internal WSDL generation
NOTE: NOT FUNCTIONAL

param: string $serviceName, name of the service
param: string $namespace, tns namespace

Class: wsdl  - X-Ref

parses a WSDL file, allows access to it's data, other utility methods

wsdl($wsdl = '',$proxyhost=false,$proxyport=false)   X-Ref
constructor

param: string $wsdl WSDL document URL

parseWSDL($wsdl = '')   X-Ref
parses the wsdl document

param: string $wsdl path or URL

start_element($parser, $name, $attrs)   X-Ref
start-element handler

param: string $parser XML parser object
param: string $name element name
param: string $attrs associative array of attributes

end_element($parser, $name)   X-Ref
end-element handler

param: string $parser XML parser object
param: string $name element name

character_data($parser, $data)   X-Ref
element content handler

param: string $parser XML parser object
param: string $data element content

getBindingData($binding)   X-Ref
No description

getOperations($bindingType = 'soap')   X-Ref
returns an assoc array of operation names => operation data
NOTE: currently only supports multiple services of differing binding types
This method needs some work

param: string $bindingType eg: soap, smtp, dime (only soap is currently supported)
return: array

getOperationData($operation, $bindingType = 'soap')   X-Ref
returns an associative array of data necessary for calling an operation

param: string $operation , name of operation
param: string $bindingType , type of binding eg: soap
return: array

serialize()   X-Ref
serialize the parsed wsdl

return: string , serialization of WSDL

serializeRPCParameters($operation, $direction, $parameters)   X-Ref
serialize a PHP value according to a WSDL message definition

TODO
- multi-ref serialization
- validate PHP values against type definitions, return errors if invalid

param: string $ type name
param: mixed $ param value
return: mixed new param or false if initial value didn't validate

serializeType($name, $type, $value, $use='encoded')   X-Ref
serializes a PHP value according a given type definition

param: string $name , name of type (part)
param: string $type , type of type, heh (type or element)
param: mixed $value , a native PHP value (parameter value)
param: string $use , use for part (encoded|literal)
return: string serialization

addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '')   X-Ref
register a service with the server

param: string $methodname
param: string $in assoc array of input values: key = param name, value = param type
param: string $out assoc array of output values: key = param name, value = param type
param: string $namespace
param: string $soapaction
param: string $style (rpc|literal)

Class: soap_parser  - X-Ref

soap_parser class parses SOAP XML messages into native PHP values

soap_parser($xml,$encoding='UTF-8',$method='')   X-Ref
constructor

param: string $xml SOAP message
param: string $encoding character encoding scheme of message

start_element($parser, $name, $attrs)   X-Ref
start-element handler

param: string $parser XML parser object
param: string $name element name
param: string $attrs associative array of attributes

end_element($parser, $name)   X-Ref
end-element handler

param: string $parser XML parser object
param: string $name element name

character_data($parser, $data)   X-Ref
element content handler

param: string $parser XML parser object
param: string $data element content

get_response()   X-Ref
get the parsed message

return: mixed

getHeaders()   X-Ref
get the parsed headers

return: string XML or empty if no headers

decode_entities($text)   X-Ref
decodes entities

param: string $text string to translate

buildVal($pos)   X-Ref
builds response structures for compound values (arrays/structs)

param: string $pos position in node tree

Class: soapclient  - X-Ref

soapclient higher level class for easy usage.

usage:

// instantiate client with server info
$soapclient = new soapclient( string path [ ,boolean wsdl] );

// call method, get results
echo $soapclient->call( string methodname [ ,array parameters] );

// bye bye client
unset($soapclient);

soapclient($endpoint,$wsdl = false)   X-Ref
constructor

param: string $endpoint SOAP server or WSDL URL
param: bool $wsdl optional, set to true if using WSDL
param: int $portName optional portName in WSDL document

call($operation,$params=array()   X-Ref
calls method, returns PHP native type

param: string $method SOAP server URL or path
param: array $params array of parameters, can be associative or not
param: string $namespace optional method namespace
param: string $soapAction optional SOAPAction value
param: boolean $headers optional array of soapval objects for headers
param: boolean $rpcParams optional treat params as RPC for use="literal"
return: mixed

getOperationData($operation)   X-Ref
get available data pertaining to an operation

param: string $operation operation name
return: array array of data pertaining to the operation

send($msg, $soapaction = '', $timeout=0)   X-Ref
send the SOAP message

Note: if the operation has multiple return values
the return value of this method will be an array
of those values.

param: string $msg a SOAPx4 soapmsg object
param: string $soapaction SOAPAction value
param: integer $timeout set timeout in seconds
return: mixed native PHP types.

parseResponse($data)   X-Ref
processes SOAP message returned from server

param: string unprocessed response data from server
return: mixed value of the message, decoded into a PHP type

setHeaders($headers)   X-Ref
set the SOAP headers

param: $headers string XML

getHeaders()   X-Ref
get the response headers

return: mixed object SOAPx4 soapval object or empty if no headers

setHTTPProxy($proxyhost, $proxyport)   X-Ref
set proxy info here

param: string $proxyhost
param: string $proxyport

setCredentials($username, $password)   X-Ref
if authenticating, set user credentials here

param: string $username
param: string $password

setHTTPEncoding($enc='gzip, deflate')   X-Ref
use HTTP encoding

param: string $enc

useHTTPPersistentConnection()   X-Ref
use HTTP persistent connections if possible


getDefaultRpcParams()   X-Ref
gets the default RPC parameter setting.
If true, default is that call params are like RPC even for document style.
Each call() can override this value.


setDefaultRpcParams($rpcParams)   X-Ref
sets the default RPC parameter setting.
If true, default is that call params are like RPC even for document style
Each call() can override this value.

param: boolean $rpcParams

getProxy()   X-Ref
dynamically creates proxy class, allowing user to directly call methods from wsdl

return: object soap_proxy object



Generated: Thu Jan 8 03:00:03 2009 Cross-referenced by PHPXref 0.7