Class wsdl

Description

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

  • access: public
  • version: $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
  • author: Dietrich Ayala <dietrich@ganx4.com>

Located in /nusoap.php (line 4074)

nusoap_base
   |
   --wsdl
Variable Summary
Method Summary
 wsdl wsdl ([string $wsdl = ''], [string $proxyhost = false], [string $proxyport = false], [string $proxyusername = false], [string $proxypassword = false], integer $timeout, [integer $response_timeout = 30])
 void addComplexType (string $name, [string $typeClass = 'complexType'], [string $phpType = 'array'], [string $compositor = ''], [string $restrictionBase = ''], [array $elements = array()], [array $attrs = array()], [string $arrayType = ''])
 void addElement (array $attrs)
 void addOperation (string $name, [array $in = false], [array $out = false], [string $namespace = false], [string $soapaction = false], [string $style = 'rpc'], [string $use = 'encoded'], [string $documentation = ''], [string $encodingStyle = ''])
 void addSimpleType (string $name, [string $restrictionBase = ''], [string $typeClass = 'simpleType'], [string $phpType = 'scalar'], [array $enumeration = array()])
 void character_data (string $parser, string $data)
 void end_element (string $parser, string $name)
 void getBindingData (mixed $binding)
 array getOperationData (string $operation, [string $bindingType = 'soap'])
 array getOperationDataForSoapAction (string $soapAction, [string $bindingType = 'soap'])
 array getOperations ([string $bindingType = 'soap'])
 mixed getTypeDef ($type $type, $ns $ns)
 void parseWSDL ([string $wsdl = ''])
 string serialize (mixed $debug)
 string serializeComplexTypeAttributes (array $typeDef, mixed $value, string $ns, string $uqType)
 string serializeComplexTypeElements (array $typeDef, mixed $value, string $ns, string $uqType, [string $use = 'encoded'], [string $encodingStyle = false])
 mixed serializeParameters (mixed $operation, mixed $direction, mixed $parameters, mixed $)
 mixed serializeRPCParameters (string $operation, string $direction, mixed $parameters)
 string serializeType (string $name, string $type, mixed $value, [string $use = 'encoded'], [string $encodingStyle = false], [boolean $unqualified = false])
 void start_element (string $parser, string $name, string $attrs)
 void webDescription ()
Variables
mixed $bindings = array() (line 4087)
mixed $complexTypes = array() (line 4081)
mixed $currentBinding (line 4088)
mixed $currentMessage (line 4083)
mixed $currentOperation (line 4084)
mixed $currentPort (line 4090)
mixed $currentPortType (line 4086)
mixed $currentSchema (line 4079)
mixed $depth = 0 (line 4100)
mixed $depth_array = array() (line 4101)
mixed $documentation = false (line 4093)
mixed $endpoint = '' (line 4094)
mixed $import = array() (line 4096)
mixed $message = array() (line 4080)
mixed $messages = array() (line 4082)
mixed $opData = array() (line 4091)
mixed $parser (line 4098)
mixed $ports = array() (line 4089)
mixed $portTypes = array() (line 4085)
mixed $position = 0 (line 4099)
mixed $proxyhost = '' (line 4103)
mixed $proxypassword = '' (line 4106)
mixed $proxyport = '' (line 4104)
mixed $proxyusername = '' (line 4105)
mixed $response_timeout = 30 (line 4108)
mixed $schemas = array() (line 4078)
mixed $status = '' (line 4092)
mixed $timeout = 0 (line 4107)
mixed $wsdl (line 4076)

Inherited Variables

Inherited from nusoap_base

nusoap_base::$charencoding
nusoap_base::$debugLevel
nusoap_base::$debug_str
nusoap_base::$error_str
nusoap_base::$namespaces
nusoap_base::$revision
nusoap_base::$soap_defencoding
nusoap_base::$title
nusoap_base::$typemap
nusoap_base::$usedNamespaces
nusoap_base::$version
nusoap_base::$xmlEntities
nusoap_base::$XMLSchemaVersion
Methods
Constructor wsdl (line 4122)

constructor

  • access: public
wsdl wsdl ([string $wsdl = ''], [string $proxyhost = false], [string $proxyport = false], [string $proxyusername = false], [string $proxypassword = false], integer $timeout, [integer $response_timeout = 30])
  • string $wsdl: WSDL document URL
  • string $proxyhost
  • string $proxyport
  • string $proxyusername
  • string $proxypassword
  • integer $timeout: set the connection timeout
  • integer $response_timeout: set the response timeout
addComplexType (line 5550)

adds an XML Schema complex type to the WSDL types

  • access: public
  • see: xmlschema
void addComplexType (string $name, [string $typeClass = 'complexType'], [string $phpType = 'array'], [string $compositor = ''], [string $restrictionBase = ''], [array $elements = array()], [array $attrs = array()], [string $arrayType = ''])
  • string $name: name
  • string $typeClass: typeClass (complexType|simpleType|attribute)
  • string $phpType: phpType: currently supported are array and struct (php assoc array)
  • string $compositor: compositor (all|sequence|choice)
  • string $restrictionBase: restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
  • array $elements: elements = array ( name => array(name=>'',type=>'') )
  • array $attrs: attrs = array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]'))
  • string $arrayType: arrayType: namespace:name (xsd:string)
addElement (line 5609)

adds an element to the WSDL types

  • access: public
  • see: xmlschema
void addElement (array $attrs)
  • array $attrs: attributes that must include name and type
addOperation (line 5628)

register an operation with the server

  • access: public
void addOperation (string $name, [array $in = false], [array $out = false], [string $namespace = false], [string $soapaction = false], [string $style = 'rpc'], [string $use = 'encoded'], [string $documentation = ''], [string $encodingStyle = ''])
  • string $name: operation (method) name
  • array $in: assoc array of input values: key = param name, value = param type
  • array $out: assoc array of output values: key = param name, value = param type
  • string $namespace: optional The namespace for the operation
  • string $soapaction: optional The soapaction for the operation
  • string $style: (rpc|document) optional The style for the operation Note: when 'document' is specified, parameter and return wrappers are created for you automatically
  • string $use: (encoded|literal) optional The use for the parameters (cannot mix right now)
  • string $documentation: optional The description to include in the WSDL
  • string $encodingStyle: optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
addSimpleType (line 5595)

adds an XML Schema simple type to the WSDL types

  • access: public
  • see: xmlschema
void addSimpleType (string $name, [string $restrictionBase = ''], [string $typeClass = 'simpleType'], [string $phpType = 'scalar'], [array $enumeration = array()])
  • string $name
  • string $restrictionBase: namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
  • string $typeClass: (should always be simpleType)
  • string $phpType: (should always be scalar)
  • array $enumeration: array of values
character_data (line 4575)

element content handler

  • access: private
void character_data (string $parser, string $data)
  • string $parser: XML parser object
  • string $data: element content
end_element (line 4545)

end-element handler

  • access: private
void end_element (string $parser, string $name)
  • string $parser: XML parser object
  • string $name: element name
getBindingData (line 4586)
void getBindingData (mixed $binding)
getOperationData (line 4630)

returns an associative array of data necessary for calling an operation

  • access: public
array getOperationData (string $operation, [string $bindingType = 'soap'])
  • string $operation: , name of operation
  • string $bindingType: , type of binding eg: soap
getOperationDataForSoapAction (line 4660)

returns an associative array of data necessary for calling an operation

  • access: public
array getOperationDataForSoapAction (string $soapAction, [string $bindingType = 'soap'])
  • string $soapAction: soapAction for operation
  • string $bindingType: type of binding eg: soap
getOperations (line 4600)

returns an assoc array of operation names => operation data

  • access: public
array getOperations ([string $bindingType = 'soap'])
  • string $bindingType: eg: soap, smtp, dime (only soap is currently supported)
getTypeDef (line 4696)

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 )

  • see: xmlschema
  • access: public
mixed getTypeDef ($type $type, $ns $ns)
  • $type $type: string the type
  • $ns $ns: string namespace (not prefix) of the type
parseWSDL (line 4232)

parses the wsdl document

  • access: private
void parseWSDL ([string $wsdl = ''])
  • string $wsdl: path or URL
serialize (line 4792)

serialize the parsed wsdl

  • return: serialization of WSDL
  • access: public
string serialize (mixed $debug)
  • mixed $debug: whether to put debug=1 in endpoint URL
serializeComplexTypeAttributes (line 5386)

serializes the attributes for a complexType

  • return: value serialized as an XML string
  • access: private
string serializeComplexTypeAttributes (array $typeDef, mixed $value, string $ns, string $uqType)
  • array $typeDef: our internal representation of an XML schema type (or element)
  • mixed $value: a native PHP value (parameter value)
  • string $ns: the namespace of the type
  • string $uqType: the local part of the type
serializeComplexTypeElements (line 5448)

serializes the elements for a complexType

  • return: value serialized as an XML string
  • access: private
string serializeComplexTypeElements (array $typeDef, mixed $value, string $ns, string $uqType, [string $use = 'encoded'], [string $encodingStyle = false])
  • array $typeDef: our internal representation of an XML schema type (or element)
  • mixed $value: a native PHP value (parameter value)
  • string $ns: the namespace of the type
  • string $uqType: the local part of the type
  • string $use: use for part (encoded|literal)
  • string $encodingStyle: SOAP encoding style for the value (if different than the enclosing style)
serializeParameters (line 5010)

serialize a PHP value according to a WSDL message definition

TODO

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

  • return: new param or false if initial value didn't validate
  • deprecated:
  • access: public
mixed serializeParameters (mixed $operation, mixed $direction, mixed $parameters, mixed $)
  • mixed $: param value
serializeRPCParameters (line 4931)

serialize PHP values according to a WSDL message definition

TODO

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

  • return: parameters serialized as XML or false on error (e.g. operation not found)
  • access: public
mixed serializeRPCParameters (string $operation, string $direction, mixed $parameters)
  • string $operation: operation name
  • string $direction: (input|output)
  • mixed $parameters: parameter value(s)
serializeType (line 5089)

serializes a PHP value according a given type definition

  • return: value serialized as an XML string
  • access: private
string serializeType (string $name, string $type, mixed $value, [string $use = 'encoded'], [string $encodingStyle = false], [boolean $unqualified = false])
  • string $name: name of value (part or element)
  • string $type: XML schema type of value (type or element)
  • mixed $value: a native PHP value (parameter value)
  • string $use: use for part (encoded|literal)
  • string $encodingStyle: SOAP encoding style for the value (if different than the enclosing style)
  • boolean $unqualified: a kludge for what should be XML namespace form handling
start_element (line 4332)

start-element handler

  • access: private
void start_element (string $parser, string $name, string $attrs)
  • string $parser: XML parser object
  • string $name: element name
  • string $attrs: associative array of attributes
webDescription (line 4743)

prints html description of services

  • access: private
void webDescription ()

Inherited Methods

Inherited From nusoap_base

 nusoap_base::nusoap_base()
 nusoap_base::appendDebug()
 nusoap_base::clearDebug()
 nusoap_base::contractQname()
 nusoap_base::debug()
 nusoap_base::expandEntities()
 nusoap_base::expandQname()
 nusoap_base::formatDump()
 nusoap_base::getDebug()
 nusoap_base::getDebugAsXMLComment()
 nusoap_base::getDebugLevel()
 nusoap_base::getError()
 nusoap_base::getGlobalDebugLevel()
 nusoap_base::getLocalPart()
 nusoap_base::getmicrotime()
 nusoap_base::getNamespaceFromPrefix()
 nusoap_base::getPrefix()
 nusoap_base::getPrefixFromNamespace()
 nusoap_base::isArraySimpleOrStruct()
 nusoap_base::serializeEnvelope()
 nusoap_base::serialize_val()
 nusoap_base::setDebugLevel()
 nusoap_base::setError()
 nusoap_base::setGlobalDebugLevel()
 nusoap_base::varDump()

Documentation generated on Wed, 3 Aug 2005 21:29:40 -0400 by phpDocumentor 1.3.0RC3