Class wsdl

Description

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

also builds WSDL structures programmatically.

Located in /nusoap.php (line 4493)

nusoap_base
   |
   --wsdl
Variable Summary
 mixed $authtype
 mixed $bindings
 mixed $certRequest
 mixed $currentPort
 mixed $depth
 mixed $depth_array
 mixed $endpoint
 mixed $import
 mixed $message
 mixed $messages
 mixed $opData
 mixed $parser
 mixed $password
 mixed $ports
 mixed $portTypes
 mixed $position
 mixed $proxyhost
 mixed $proxyport
 mixed $schemas
 mixed $status
 mixed $timeout
 mixed $username
 mixed $use_curl
 mixed $wsdl
Method Summary
 wsdl wsdl ([string $wsdl = ''], [string $proxyhost = false], [string $proxyport = false], [string $proxyusername = false], [string $proxypassword = false], integer $timeout, [integer $response_timeout = 30], [array $curl_options = null], [boolean $use_curl = false])
 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 fetchWSDL (mixed $wsdl)
 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 (string $type, string $ns)
 boolean parametersMatchWrapped (string $type, array &$parameters)
 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 (string $operation, string $direction, mixed $parameters)
 mixed serializeRPCParameters (string $operation, string $direction, mixed $parameters, [string $bindingType = 'soap'])
 string serializeType (string $name, string $type, mixed $value, [string $use = 'encoded'], [string $encodingStyle = false], [boolean $unqualified = false])
 void setCredentials (string $username, string $password, [string $authtype = 'basic'], [array $certRequest = array()])
 void start_element (string $parser, string $name, string $attrs)
 void webDescription ()
Variables
mixed $authtype = '' (line 4533)
mixed $bindings = array() (line 4506)
mixed $certRequest = array() (line 4534)
mixed $complexTypes = array() (line 4500)
mixed $curl_options = array() (line 4528)
mixed $currentBinding (line 4507)
mixed $currentMessage (line 4502)
mixed $currentOperation (line 4503)
mixed $currentPort (line 4509)
mixed $currentPortType (line 4505)
mixed $currentSchema (line 4498)
mixed $depth = 0 (line 4519)
mixed $depth_array = array() (line 4520)
mixed $documentation = false (line 4512)
mixed $endpoint = '' (line 4513)
mixed $import = array() (line 4515)
mixed $message = array() (line 4499)
mixed $messages = array() (line 4501)
mixed $opData = array() (line 4510)
mixed $parser (line 4517)
mixed $password = '' (line 4532)
mixed $ports = array() (line 4508)
mixed $portTypes = array() (line 4504)
mixed $position = 0 (line 4518)
mixed $proxyhost = '' (line 4522)
mixed $proxypassword = '' (line 4525)
mixed $proxyport = '' (line 4523)
mixed $proxyusername = '' (line 4524)
mixed $response_timeout = 30 (line 4527)
mixed $schemas = array() (line 4497)
mixed $status = '' (line 4511)
mixed $timeout = 0 (line 4526)
mixed $username = '' (line 4531)
mixed $use_curl = false (line 4529)
mixed $wsdl (line 4495)

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 4550)

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], [array $curl_options = null], [boolean $use_curl = false])
  • 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
  • array $curl_options: user-specified cURL options
  • boolean $use_curl: try to use cURL
addComplexType (line 6142)

adds an XML Schema complex type to the WSDL types

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

adds an element to the WSDL types

void addElement (array $attrs)
  • array $attrs: attributes that must include name and type
addOperation (line 6222)

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 6189)

adds an XML Schema simple type to the WSDL types

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 5020)

element content handler

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

end-element handler

  • access: private
void end_element (string $parser, string $name)
  • string $parser: XML parser object
  • string $name: element name
fetchWSDL (line 4570)

fetches the WSDL document and parses it

  • access: public
void fetchWSDL (mixed $wsdl)
getBindingData (line 5049)
void getBindingData (mixed $binding)
getOperationData (line 5094)

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, soap12
getOperationDataForSoapAction (line 5126)

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, soap12
getOperations (line 5063)

returns an assoc array of operation names => operation data

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

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 )

mixed getTypeDef (string $type, string $ns)
  • string $type: the type
  • string $ns: namespace (not prefix) of the type
parametersMatchWrapped (line 5408)

determine whether a set of parameters are unwrapped when they are expect to be wrapped, Microsoft-style.

  • return: whether they parameters are unwrapped (and should be wrapped)
boolean parametersMatchWrapped (string $type, array &$parameters)
  • string $type: the type (element name) of the wrapper
  • array $parameters: the parameter values for the SOAP call
parseWSDL (line 4673)

parses the wsdl document

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

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 5978)

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 6040)

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 5595)

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: parameters serialized as XML or false on error (e.g. operation not found)
  • deprecated:
  • access: public
mixed serializeParameters (string $operation, string $direction, mixed $parameters)
  • string $operation: operation name
  • string $direction: (input|output)
  • mixed $parameters: parameter value(s)
serializeRPCParameters (line 5501)

serialize PHP values according to a WSDL message definition contrary to the method name, this is not limited to RPC

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 $bindingType = 'soap'])
  • string $operation: operation name
  • string $direction: (input|output)
  • mixed $parameters: parameter value(s)
  • string $bindingType: (soap|soap12)
serializeType (line 5674)

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
setCredentials (line 5040)

if authenticating, set user credentials here

  • access: public
void setCredentials (string $username, string $password, [string $authtype = 'basic'], [array $certRequest = array()])
  • string $username
  • string $password
  • string $authtype: (basic|digest|certificate|ntlm)
  • array $certRequest: (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)
start_element (line 4777)

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 5220)

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()
 nusoap_base::__toString()

Documentation generated on Tue, 06 Nov 2007 10:38:23 -0500 by phpDocumentor 1.3.0RC3