## wsdl

Description

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

also builds WSDL structures programmatically.

- access: public
- version: $Id: wsdl.html,v 1.2 2010/04/26 20:25:21 snichol Exp $
- author: Dietrich Ayala <dietrich@ganx4.com>
- author: Scott Nichol <snichol@users.sourceforge.net>

Located in /nusoap.php (line 4596)

    nusoap_base
       |
       --wsdl

Variable Summary
mixed $authtype
mixed $bindings
mixed $certRequest
mixed $complexTypes
mixed $curl_options
mixed $currentBinding
mixed $currentMessage
mixed $currentOperation
mixed $currentPort
mixed $currentPortType
mixed $currentSchema
mixed $depth
mixed $depth_array
mixed $documentation
mixed $endpoint
mixed $import
mixed $message
mixed $messages
mixed $opData
mixed $parser
mixed $password
mixed $ports
mixed $portTypes
mixed $position
mixed $proxyhost
mixed $proxypassword
mixed $proxyport
mixed $proxyusername
mixed $response_timeout
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 $portName = ''], [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 4636)
mixed $bindings = array() (line 4609)
mixed $certRequest = array() (line 4637)
mixed $complexTypes = array() (line 4603)
mixed $curl_options = array() (line 4631)
mixed $currentBinding (line 4610)
mixed $currentMessage (line 4605)
mixed $currentOperation (line 4606)
mixed $currentPort (line 4612)
mixed $currentPortType (line 4608)
mixed $currentSchema (line 4601)
mixed $depth = 0 (line 4622)
mixed $depth_array = array() (line 4623)
mixed $documentation = false (line 4615)
mixed $endpoint = '' (line 4616)
mixed $import = array() (line 4618)
mixed $message = array() (line 4602)
mixed $messages = array() (line 4604)
mixed $opData = array() (line 4613)
mixed $parser (line 4620)
mixed $password = '' (line 4635)
mixed $ports = array() (line 4611)
mixed $portTypes = array() (line 4607)
mixed $position = 0 (line 4621)
mixed $proxyhost = '' (line 4625)
mixed $proxypassword = '' (line 4628)
mixed $proxyport = '' (line 4626)
mixed $proxyusername = '' (line 4627)
mixed $response_timeout = 30 (line 4630)
mixed $schemas = array() (line 4600)
mixed $status = '' (line 4614)
mixed $timeout = 0 (line 4629)
mixed $username = '' (line 4634)
mixed $use_curl = false (line 4632)
mixed $wsdl (line 4598)

#### 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 4653)

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

adds an XML Schema complex type to the WSDL types

- access: public
- see: nusoap_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
- 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 6339)

adds an element to the WSDL types

- access: public
- see: nusoap_xmlschema

void addElement (array $attrs)

- array $attrs: attributes that must include name and type

addOperation (line 6358)

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

adds an XML Schema simple type to the WSDL types

- access: public
- see: nusoap_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 5123)

element content handler

- access: private

void character_data (string $parser, string $data)

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

end_element (line 5093)

end-element handler

- access: private

void end_element (string $parser, string $name)

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

fetchWSDL (line 4673)

fetches the WSDL document and parses it

- access: public

void fetchWSDL (mixed $wsdl)
getBindingData (line 5152)
void getBindingData (mixed $binding)
getOperationData (line 5207)

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

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

returns an assoc array of operation names => operation data

- access: public

array getOperations ([string $portName = ''], [string $bindingType = 'soap'])

- string $portName: WSDL port name
- string $bindingType: eg: soap, smtp, dime (only soap and soap12 are currently supported)

getTypeDef (line 5277)

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: nusoap_xmlschema
- access: public

mixed getTypeDef (string $type, string $ns)

- string $type: the type
- string $ns: namespace (not prefix) of the type

parametersMatchWrapped (line 5525)

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)
- access: private

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

parses the wsdl document

- access: private

void parseWSDL ([string $wsdl = ''])

- string $wsdl: path or URL

serialize (line 5386)

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

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

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

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

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

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

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

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

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 Mon, 26 Apr 2010 16:17:07 -0400 by phpDocumentor 1.3.0RC3