ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
wsdl Class Reference

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

+ Inheritance diagram for wsdl:
+ Collaboration diagram for wsdl:

Public Member Functions

 wsdl ($wsdl='', $proxyhost=false, $proxyport=false, $proxyusername=false, $proxypassword=false, $timeout=0, $response_timeout=30)
 constructor More...
 
 parseWSDL ($wsdl='')
 parses the wsdl document More...
 
 start_element ($parser, $name, $attrs)
 start-element handler More...
 
 end_element ($parser, $name)
 end-element handler More...
 
 character_data ($parser, $data)
 element content handler More...
 
 getBindingData ($binding)
 
 getOperations ($bindingType='soap')
 returns an assoc array of operation names => operation data More...
 
 getOperationData ($operation, $bindingType='soap')
 returns an associative array of data necessary for calling an operation More...
 
 getTypeDef ($type, $ns)
 returns an array of information about a given type returns false if no type exists by the given name More...
 
 serialize ()
 serialize the parsed wsdl More...
 
 serializeRPCParameters ($operation, $direction, $parameters)
 serialize a PHP value according to a WSDL message definition More...
 
 serializeParameters ($operation, $direction, $parameters)
 serialize a PHP value according to a WSDL message definition More...
 
 serializeType ($name, $type, $value, $use='encoded', $encodingStyle=false)
 serializes a PHP value according a given type definition More...
 
 addComplexType ($name, $typeClass='complexType', $phpType='array', $compositor='', $restrictionBase='', $elements=array(), $attrs=array(), $arrayType='')
 adds an XML Schema complex type to the WSDL types More...
 
 addSimpleType ($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar')
 adds an XML Schema simple type to the WSDL types More...
 
 addOperation ($name, $in=false, $out=false, $namespace=false, $soapaction=false, $style='rpc', $use='encoded', $documentation='')
 register a service with the server More...
 
 __construct ($wsdl='', $proxyhost=false, $proxyport=false, $proxyusername=false, $proxypassword=false, $timeout=0, $response_timeout=30, $curl_options=null, $use_curl=false)
 constructor More...
 
 fetchWSDL ($wsdl)
 fetches the WSDL document and parses it More...
 
 parseWSDL ($wsdl='')
 parses the wsdl document More...
 
 start_element ($parser, $name, $attrs)
 start-element handler More...
 
 end_element ($parser, $name)
 end-element handler More...
 
 character_data ($parser, $data)
 element content handler More...
 
 setCredentials ($username, $password, $authtype='basic', $certRequest=array())
 if authenticating, set user credentials here More...
 
 getBindingData ($binding)
 
 getOperations ($bindingType='soap')
 returns an assoc array of operation names => operation data More...
 
 getOperationData ($operation, $bindingType='soap')
 returns an associative array of data necessary for calling an operation More...
 
 getOperationDataForSoapAction ($soapAction, $bindingType='soap')
 returns an associative array of data necessary for calling an operation More...
 
 getTypeDef ($type, $ns)
 returns an array of information about a given type returns false if no type exists by the given name More...
 
 webDescription ()
 prints html description of services More...
 
 serialize ($debug=0)
 serialize the parsed wsdl More...
 
 parametersMatchWrapped ($type, &$parameters)
 determine whether a set of parameters are unwrapped when they are expect to be wrapped, Microsoft-style. More...
 
 serializeRPCParameters ($operation, $direction, $parameters, $bindingType='soap')
 serialize PHP values according to a WSDL message definition contrary to the method name, this is not limited to RPC More...
 
 serializeParameters ($operation, $direction, $parameters)
 serialize a PHP value according to a WSDL message definition More...
 
 serializeType ($name, $type, $value, $use='encoded', $encodingStyle=false, $unqualified=false)
 serializes a PHP value according a given type definition More...
 
 serializeComplexTypeAttributes ($typeDef, $value, $ns, $uqType)
 serializes the attributes for a complexType More...
 
 serializeComplexTypeElements ($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false)
 serializes the elements for a complexType More...
 
 addComplexType ($name, $typeClass='complexType', $phpType='array', $compositor='', $restrictionBase='', $elements=array(), $attrs=array(), $arrayType='')
 adds an XML Schema complex type to the WSDL types More...
 
 addSimpleType ($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array())
 adds an XML Schema simple type to the WSDL types More...
 
 addElement ($attrs)
 adds an element to the WSDL types More...
 
 addOperation ($name, $in=false, $out=false, $namespace=false, $soapaction=false, $style='rpc', $use='encoded', $documentation='', $encodingStyle='')
 register an operation with the server More...
 
- Public Member Functions inherited from nusoap_base
 debug ($string)
 adds debug data to the class level debug string More...
 
 expandEntities ($val)
 expands entities, e.g. More...
 
 getError ()
 returns error string if present More...
 
 setError ($str)
 sets error string More...
 
 isArraySimpleOrStruct ($val)
 detect if array is a simple array or a struct (associative array) More...
 
 serialize_val ($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded')
 serializes PHP values in accordance w/ section 5. More...
 
 serializeEnvelope ($body, $headers=false, $namespaces=array(), $style='rpc', $use='encoded')
 serialize message More...
 
 formatDump ($str)
 
 contractQname ($qname)
 contracts a qualified name More...
 
 expandQname ($qname)
 expands a qualified name More...
 
 getLocalPart ($str)
 returns the local part of a prefixed string returns the original string, if not prefixed More...
 
 getPrefix ($str)
 returns the prefix part of a prefixed string returns false, if not prefixed More...
 
 getNamespaceFromPrefix ($prefix)
 pass it a prefix, it returns a namespace returns false if no namespace registered with the given prefix More...
 
 getPrefixFromNamespace ($ns)
 returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace More...
 
 varDump ($data)
 
 __construct ()
 constructor More...
 
 getGlobalDebugLevel ()
 gets the global debug level, which applies to future instances More...
 
 setGlobalDebugLevel ($level)
 sets the global debug level, which applies to future instances More...
 
 getDebugLevel ()
 gets the debug level for this instance More...
 
 setDebugLevel ($level)
 sets the debug level for this instance More...
 
 debug ($string)
 adds debug data to the instance debug string with formatting More...
 
 appendDebug ($string)
 adds debug data to the instance debug string without formatting More...
 
 clearDebug ()
 clears the current debug data for this instance More...
 
getDebug ()
 gets the current debug data for this instance More...
 
getDebugAsXMLComment ()
 gets the current debug data for this instance as an XML comment this may change the contents of the debug data More...
 
 expandEntities ($val)
 expands entities, e.g. More...
 
 getError ()
 returns error string if present More...
 
 setError ($str)
 sets error string More...
 
 isArraySimpleOrStruct ($val)
 detect if array is a simple array or a struct (associative array) More...
 
 serialize_val ($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded', $soapval=false)
 serializes PHP values in accordance w/ section 5. More...
 
 serializeEnvelope ($body, $headers=false, $namespaces=array(), $style='rpc', $use='encoded', $encodingStyle='http://schemas.xmlsoap.org/soap/encoding/')
 serializes a message More...
 
 formatDump ($str)
 formats a string to be inserted into an HTML stream More...
 
 contractQname ($qname)
 contracts (changes namespace to prefix) a qualified name More...
 
 expandQname ($qname)
 expands (changes prefix to namespace) a qualified name More...
 
 getLocalPart ($str)
 returns the local part of a prefixed string returns the original string, if not prefixed More...
 
 getPrefix ($str)
 returns the prefix part of a prefixed string returns false, if not prefixed More...
 
 getNamespaceFromPrefix ($prefix)
 pass it a prefix, it returns a namespace More...
 
 getPrefixFromNamespace ($ns)
 returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace More...
 
 getmicrotime ()
 returns the time in ODBC canonical form with microseconds More...
 
 varDump ($data)
 Returns a string with the output of var_dump. More...
 
 __toString ()
 represents the object as a string More...
 

Data Fields

 $wsdl
 
 $schemas = array()
 
 $currentSchema
 
 $message = array()
 
 $complexTypes = array()
 
 $messages = array()
 
 $currentMessage
 
 $currentOperation
 
 $portTypes = array()
 
 $currentPortType
 
 $bindings = array()
 
 $currentBinding
 
 $ports = array()
 
 $currentPort
 
 $opData = array()
 
 $status = ''
 
 $documentation = false
 
 $endpoint = ''
 
 $import = array()
 
 $parser
 
 $position = 0
 
 $depth = 0
 
 $depth_array = array()
 
 $proxyhost = ''
 
 $proxyport = ''
 
 $proxyusername = ''
 
 $proxypassword = ''
 
 $timeout = 0
 
 $response_timeout = 30
 
 $curl_options = array()
 
 $use_curl = false
 
 $username = ''
 
 $password = ''
 
 $authtype = ''
 
 $certRequest = array()
 
- Data Fields inherited from nusoap_base
 $title = 'NuSOAP'
 
 $version = '0.6.7'
 
 $revision = '$Revision$'
 
 $error_str = false
 
 $debug_str = ''
 
 $charencoding = true
 
 $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'
 
 $soap_defencoding = 'UTF-8'
 
 $namespaces
 
 $usedNamespaces = array()
 
 $typemap
 
 $xmlEntities
 
 $debugLevel
 

Detailed Description

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

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

Author
Dietrich Ayala dietr.nosp@m.ich@.nosp@m.ganx4.nosp@m..com public

also builds WSDL structures programmatically.

Author
Dietrich Ayala dietr.nosp@m.ich@.nosp@m.ganx4.nosp@m..com
Scott Nichol snich.nosp@m.ol@u.nosp@m.sers..nosp@m.sour.nosp@m.cefor.nosp@m.ge.n.nosp@m.et
Version
$Id$ public

Definition at line 3133 of file nusoap.php.

Constructor & Destructor Documentation

◆ __construct()

wsdl::__construct (   $wsdl = '',
  $proxyhost = false,
  $proxyport = false,
  $proxyusername = false,
  $proxypassword = false,
  $timeout = 0,
  $response_timeout = 30,
  $curl_options = null,
  $use_curl = false 
)

constructor

Parameters
string$wsdlWSDL document URL
string$proxyhost
string$proxyport
string$proxyusername
string$proxypassword
integer$timeoutset the connection timeout
integer$response_timeoutset the response timeout
array$curl_optionsuser-specified cURL options
boolean$use_curltry to use cURL public

Definition at line 4568 of file nusoap.php.

References nusoap_base\debug().

4568  {
4569  parent::__construct();
4570  $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
4571  $this->proxyhost = $proxyhost;
4572  $this->proxyport = $proxyport;
4573  $this->proxyusername = $proxyusername;
4574  $this->proxypassword = $proxypassword;
4575  $this->timeout = $timeout;
4576  $this->response_timeout = $response_timeout;
4577  if (is_array($curl_options))
4578  $this->curl_options = $curl_options;
4579  $this->use_curl = $use_curl;
4580  $this->fetchWSDL($wsdl);
4581  }
$proxyhost
Definition: nusoap.php:3162
$wsdl
Definition: nusoap.php:3135
$use_curl
Definition: nusoap.php:4547
$proxyusername
Definition: nusoap.php:3164
$curl_options
Definition: nusoap.php:4546
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$proxyport
Definition: nusoap.php:3163
$response_timeout
Definition: nusoap.php:3167
$timeout
Definition: nusoap.php:3166
fetchWSDL($wsdl)
fetches the WSDL document and parses it
Definition: nusoap.php:4588
$proxypassword
Definition: nusoap.php:3165
+ Here is the call graph for this function:

Member Function Documentation

◆ addComplexType() [1/2]

wsdl::addComplexType (   $name,
  $typeClass = 'complexType',
  $phpType = 'array',
  $compositor = '',
  $restrictionBase = '',
  $elements = array(),
  $attrs = array(),
  $arrayType = '' 
)

adds an XML Schema complex type to the WSDL types

Parameters
name
typeClass(complexType|simpleType|attribute)
phpTypecurrently supported are array and struct (php assoc array)
compositor(all|sequence|choice)
restrictionBasenamespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
elements= array ( name = array(name=>'',type=>'') )
attrs= array( array( 'ref' => "http://schemas.xmlsoap.org/soap/encoding/:arrayType", "http://schemas.xmlsoap.org/wsdl/:arrayType" => "string[]" ) )
arrayTypenamespace:name (http://www.w3.org/2001/XMLSchema:string)
See also
xmlschema

Definition at line 4298 of file nusoap.php.

References $n, $name, and nusoap_base\expandQname().

4298  {
4299  if (count($elements) > 0) {
4300  foreach($elements as $n => $e){
4301  // expand each element
4302  foreach ($e as $k => $v) {
4303  $k = strpos($k,':') ? $this->expandQname($k) : $k;
4304  $v = strpos($v,':') ? $this->expandQname($v) : $v;
4305  $ee[$k] = $v;
4306  }
4307  $eElements[$n] = $ee;
4308  }
4309  $elements = $eElements;
4310  }
4311 
4312  if (count($attrs) > 0) {
4313  foreach($attrs as $n => $a){
4314  // expand each attribute
4315  foreach ($a as $k => $v) {
4316  $k = strpos($k,':') ? $this->expandQname($k) : $k;
4317  $v = strpos($v,':') ? $this->expandQname($v) : $v;
4318  $aa[$k] = $v;
4319  }
4320  $eAttrs[$n] = $aa;
4321  }
4322  $attrs = $eAttrs;
4323  }
4324 
4325  $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
4326  $arrayType = strpos($arrayType,':') ? $this->expandQname($arrayType) : $arrayType;
4327 
4328  $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
4329  $this->schemas[$typens][0]->addComplexType($name,$typeClass,$phpType,$compositor,$restrictionBase,$elements,$attrs,$arrayType);
4330  }
if($format !==null) $name
Definition: metadata.php:146
expandQname($qname)
expands a qualified name
Definition: nusoap.php:483
$n
Definition: RandomTest.php:85
+ Here is the call graph for this function:

◆ addComplexType() [2/2]

wsdl::addComplexType (   $name,
  $typeClass = 'complexType',
  $phpType = 'array',
  $compositor = '',
  $restrictionBase = '',
  $elements = array(),
  $attrs = array(),
  $arrayType = '' 
)

adds an XML Schema complex type to the WSDL types

Parameters
string$name
string$typeClass(complexType|simpleType|attribute)
string$phpTypecurrently supported are array and struct (php assoc array)
string$compositor(all|sequence|choice)
string$restrictionBasenamespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
array$elementse.g. array ( name => array(name=>'',type=>'') )
array$attrse.g. array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]'))
string$arrayTypeas namespace:name (xsd:string)
See also
nusoap_xmlschema User interface

Definition at line 6249 of file nusoap.php.

References $n, $name, array, and nusoap_base\expandQname().

6249  {
6250  if (count($elements) > 0) {
6251  $eElements = array();
6252  foreach($elements as $n => $e){
6253  // expand each element
6254  $ee = array();
6255  foreach ($e as $k => $v) {
6256  $k = strpos($k,':') ? $this->expandQname($k) : $k;
6257  $v = strpos($v,':') ? $this->expandQname($v) : $v;
6258  $ee[$k] = $v;
6259  }
6260  $eElements[$n] = $ee;
6261  }
6262  $elements = $eElements;
6263  }
6264 
6265  if (count($attrs) > 0) {
6266  foreach($attrs as $n => $a){
6267  // expand each attribute
6268  foreach ($a as $k => $v) {
6269  $k = strpos($k,':') ? $this->expandQname($k) : $k;
6270  $v = strpos($v,':') ? $this->expandQname($v) : $v;
6271  $aa[$k] = $v;
6272  }
6273  $eAttrs[$n] = $aa;
6274  }
6275  $attrs = $eAttrs;
6276  }
6277 
6278  $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
6279  $arrayType = strpos($arrayType,':') ? $this->expandQname($arrayType) : $arrayType;
6280 
6281  $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6282  $this->schemas[$typens][0]->addComplexType($name,$typeClass,$phpType,$compositor,$restrictionBase,$elements,$attrs,$arrayType);
6283  }
if($format !==null) $name
Definition: metadata.php:146
expandQname($qname)
expands a qualified name
Definition: nusoap.php:483
$n
Definition: RandomTest.php:85
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ addElement()

wsdl::addElement (   $attrs)

adds an element to the WSDL types

Parameters
array$attrsattributes that must include name and type
See also
nusoap_xmlschema User interface

Definition at line 6310 of file nusoap.php.

6310  {
6311  $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6312  $this->schemas[$typens][0]->addElement($attrs);
6313  }

◆ addOperation() [1/2]

wsdl::addOperation (   $name,
  $in = false,
  $out = false,
  $namespace = false,
  $soapaction = false,
  $style = 'rpc',
  $use = 'encoded',
  $documentation = '' 
)

register a service with the server

Parameters
string$methodname
string$inassoc array of input values: key = param name, value = param type
string$outassoc array of output values: key = param name, value = param type
string$namespaceoptional The namespace for the operation
string$soapactionoptional The soapaction for the operation
string$style(rpc|document) optional The style for the operation
string$use(encoded|literal) optional The use for the parameters (cannot mix right now)
string$documentationoptional The description to include in the WSDL public

Definition at line 4362 of file nusoap.php.

References $in, $name, $namespace, $out, $style, array, nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), and nusoap_base\getPrefix().

Referenced by soap_server\register(), and nusoap_server\register().

4362  {
4363  if ($style == 'rpc' && $use == 'encoded') {
4364  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
4365  } else {
4366  $encodingStyle = '';
4367  }
4368  // get binding
4369  $this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] =
4370  array(
4371  'name' => $name,
4372  'binding' => $this->serviceName . 'Binding',
4373  'endpoint' => $this->endpoint,
4374  'soapAction' => $soapaction,
4375  'style' => $style,
4376  'input' => array(
4377  'use' => $use,
4378  'namespace' => $namespace,
4379  'encodingStyle' => $encodingStyle,
4380  'message' => $name . 'Request',
4381  'parts' => $in),
4382  'output' => array(
4383  'use' => $use,
4384  'namespace' => $namespace,
4385  'encodingStyle' => $encodingStyle,
4386  'message' => $name . 'Response',
4387  'parts' => $out),
4388  'namespace' => $namespace,
4389  'transport' => 'http://schemas.xmlsoap.org/soap/http',
4390  'documentation' => $documentation);
4391  // add portTypes
4392  // add messages
4393  if($in)
4394  {
4395  foreach($in as $pName => $pType)
4396  {
4397  if(strpos($pType,':')) {
4398  $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
4399  }
4400  $this->messages[$name.'Request'][$pName] = $pType;
4401  }
4402  } else {
4403  $this->messages[$name.'Request']= '0';
4404  }
4405  if($out)
4406  {
4407  foreach($out as $pName => $pType)
4408  {
4409  if(strpos($pType,':')) {
4410  $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
4411  }
4412  $this->messages[$name.'Response'][$pName] = $pType;
4413  }
4414  } else {
4415  $this->messages[$name.'Response']= '0';
4416  }
4417  return true;
4418  }
if($err=$client->getError()) $namespace
$style
Definition: example_012.php:70
$documentation
Definition: nusoap.php:3152
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
if($format !==null) $name
Definition: metadata.php:146
Create styles array
The data for the language used.
getPrefix($str)
returns the prefix part of a prefixed string returns false, if not prefixed
Definition: nusoap.php:525
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
getNamespaceFromPrefix($prefix)
pass it a prefix, it returns a namespace returns false if no namespace registered with the given pref...
Definition: nusoap.php:541
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addOperation() [2/2]

wsdl::addOperation (   $name,
  $in = false,
  $out = false,
  $namespace = false,
  $soapaction = false,
  $style = 'rpc',
  $use = 'encoded',
  $documentation = '',
  $encodingStyle = '' 
)

register an operation with the server

Parameters
string$nameoperation (method) name
array$inassoc array of input values: key = param name, value = param type
array$outassoc array of output values: key = param name, value = param type
string$namespaceoptional The namespace for the operation
string$soapactionoptional 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$documentationoptional The description to include in the WSDL
string$encodingStyleoptional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) public

Definition at line 6329 of file nusoap.php.

References $in, $n, $name, $namespace, $out, $style, $t, array, nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), and nusoap_base\getPrefix().

6329  {
6330  if ($use == 'encoded' && $encodingStyle == '') {
6331  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
6332  }
6333 
6334  if ($style == 'document') {
6335  $elements = array();
6336  foreach ($in as $n => $t) {
6337  $elements[$n] = array('name' => $n, 'type' => $t);
6338  }
6339  $this->addComplexType($name . 'RequestType', 'complexType', 'struct', 'all', '', $elements);
6340  $this->addElement(array('name' => $name, 'type' => $name . 'RequestType'));
6341  $in = array('parameters' => 'tns:' . $name . '^');
6342 
6343  $elements = array();
6344  foreach ($out as $n => $t) {
6345  $elements[$n] = array('name' => $n, 'type' => $t);
6346  }
6347  $this->addComplexType($name . 'ResponseType', 'complexType', 'struct', 'all', '', $elements);
6348  $this->addElement(array('name' => $name . 'Response', 'type' => $name . 'ResponseType', 'form' => 'qualified'));
6349  $out = array('parameters' => 'tns:' . $name . 'Response' . '^');
6350  }
6351 
6352  // get binding
6353  $this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] =
6354  array(
6355  'name' => $name,
6356  'binding' => $this->serviceName . 'Binding',
6357  'endpoint' => $this->endpoint,
6358  'soapAction' => $soapaction,
6359  'style' => $style,
6360  'input' => array(
6361  'use' => $use,
6362  'namespace' => $namespace,
6363  'encodingStyle' => $encodingStyle,
6364  'message' => $name . 'Request',
6365  'parts' => $in),
6366  'output' => array(
6367  'use' => $use,
6368  'namespace' => $namespace,
6369  'encodingStyle' => $encodingStyle,
6370  'message' => $name . 'Response',
6371  'parts' => $out),
6372  'namespace' => $namespace,
6373  'transport' => 'http://schemas.xmlsoap.org/soap/http',
6374  'documentation' => $documentation);
6375  // add portTypes
6376  // add messages
6377  if($in)
6378  {
6379  foreach($in as $pName => $pType)
6380  {
6381  if(strpos($pType,':')) {
6382  $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
6383  }
6384  $this->messages[$name.'Request'][$pName] = $pType;
6385  }
6386  } else {
6387  $this->messages[$name.'Request']= '0';
6388  }
6389  if($out)
6390  {
6391  foreach($out as $pName => $pType)
6392  {
6393  if(strpos($pType,':')) {
6394  $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
6395  }
6396  $this->messages[$name.'Response'][$pName] = $pType;
6397  }
6398  } else {
6399  $this->messages[$name.'Response']= '0';
6400  }
6401  return true;
6402  }
if($err=$client->getError()) $namespace
$style
Definition: example_012.php:70
addComplexType($name, $typeClass='complexType', $phpType='array', $compositor='', $restrictionBase='', $elements=array(), $attrs=array(), $arrayType='')
adds an XML Schema complex type to the WSDL types
Definition: nusoap.php:4298
$documentation
Definition: nusoap.php:3152
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
addElement($attrs)
adds an element to the WSDL types
Definition: nusoap.php:6310
if($format !==null) $name
Definition: metadata.php:146
$n
Definition: RandomTest.php:85
Create styles array
The data for the language used.
getPrefix($str)
returns the prefix part of a prefixed string returns false, if not prefixed
Definition: nusoap.php:525
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
getNamespaceFromPrefix($prefix)
pass it a prefix, it returns a namespace returns false if no namespace registered with the given pref...
Definition: nusoap.php:541
+ Here is the call graph for this function:

◆ addSimpleType() [1/2]

wsdl::addSimpleType (   $name,
  $restrictionBase = '',
  $typeClass = 'simpleType',
  $phpType = 'scalar' 
)

adds an XML Schema simple type to the WSDL types

Parameters
name
restrictionBasenamespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
typeClass(simpleType)
phpType(scalar)
See also
xmlschema

Definition at line 4342 of file nusoap.php.

References $name, and nusoap_base\expandQname().

4342  {
4343  $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
4344 
4345  $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
4346  $this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType);
4347  }
if($format !==null) $name
Definition: metadata.php:146
expandQname($qname)
expands a qualified name
Definition: nusoap.php:483
+ Here is the call graph for this function:

◆ addSimpleType() [2/2]

wsdl::addSimpleType (   $name,
  $restrictionBase = '',
  $typeClass = 'simpleType',
  $phpType = 'scalar',
  $enumeration = array() 
)

adds an XML Schema simple type to the WSDL types

Parameters
string$name
string$restrictionBasenamespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
string$typeClass(should always be simpleType)
string$phpType(should always be scalar)
array$enumerationarray of values
See also
nusoap_xmlschema User interface

Definition at line 6296 of file nusoap.php.

References $name, and nusoap_base\expandQname().

6296  {
6297  $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
6298 
6299  $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6300  $this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType, $enumeration);
6301  }
if($format !==null) $name
Definition: metadata.php:146
expandQname($qname)
expands a qualified name
Definition: nusoap.php:483
+ Here is the call graph for this function:

◆ character_data() [1/2]

wsdl::character_data (   $parser,
  $data 
)

element content handler

Parameters
string$parserXML parser object
string$dataelement content private

Definition at line 3624 of file nusoap.php.

References $data.

3625  {
3626  $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0;
3627  if (isset($this->message[$pos]['cdata'])) {
3628  $this->message[$pos]['cdata'] .= $data;
3629  }
3630  if ($this->documentation) {
3631  $this->documentation .= $data;
3632  }
3633  }
$depth
Definition: nusoap.php:3159

◆ character_data() [2/2]

wsdl::character_data (   $parser,
  $data 
)

element content handler

Parameters
string$parserXML parser object
string$dataelement content private

Definition at line 5038 of file nusoap.php.

References $data.

5039  {
5040  $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0;
5041  if (isset($this->message[$pos]['cdata'])) {
5042  $this->message[$pos]['cdata'] .= $data;
5043  }
5044  if ($this->documentation) {
5045  $this->documentation .= $data;
5046  }
5047  }
$depth
Definition: nusoap.php:3159

◆ end_element() [1/2]

wsdl::end_element (   $parser,
  $name 
)

end-element handler

Parameters
string$parserXML parser object
string$nameelement name private

Definition at line 3597 of file nusoap.php.

References $name.

3597  {
3598  // unset schema status
3599  if (/*ereg('types$', $name) ||*/ ereg('schema$', $name)) {
3600  $this->status = "";
3601  $this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema;
3602  }
3603  if ($this->status == 'schema') {
3604  $this->currentSchema->schemaEndElement($parser, $name);
3605  } else {
3606  // bring depth down a notch
3607  $this->depth--;
3608  }
3609  // end documentation
3610  if ($this->documentation) {
3611  //TODO: track the node to which documentation should be assigned; it can be a part, message, etc.
3612  //$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation;
3613  $this->documentation = false;
3614  }
3615  }
$currentSchema
Definition: nusoap.php:3138
$parser
Definition: nusoap.php:3157
if($format !==null) $name
Definition: metadata.php:146

◆ end_element() [2/2]

wsdl::end_element (   $parser,
  $name 
)

end-element handler

Parameters
string$parserXML parser object
string$nameelement name private

Definition at line 5008 of file nusoap.php.

References $name, nusoap_base\appendDebug(), and nusoap_base\debug().

5008  {
5009  // unset schema status
5010  if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
5011  $this->status = "";
5012  $this->appendDebug($this->currentSchema->getDebug());
5013  $this->currentSchema->clearDebug();
5014  $this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema;
5015  $this->debug('Parsing WSDL schema done');
5016  }
5017  if ($this->status == 'schema') {
5018  $this->currentSchema->schemaEndElement($parser, $name);
5019  } else {
5020  // bring depth down a notch
5021  $this->depth--;
5022  }
5023  // end documentation
5024  if ($this->documentation) {
5025  //TODO: track the node to which documentation should be assigned; it can be a part, message, etc.
5026  //$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation;
5027  $this->documentation = false;
5028  }
5029  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:294
$currentSchema
Definition: nusoap.php:3138
$parser
Definition: nusoap.php:3157
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
if($format !==null) $name
Definition: metadata.php:146
+ Here is the call graph for this function:

◆ fetchWSDL()

wsdl::fetchWSDL (   $wsdl)

fetches the WSDL document and parses it

public

Definition at line 4588 of file nusoap.php.

References $binding, $data, $list, $url, array, and nusoap_base\debug().

Referenced by nusoap_client\loadWSDL().

4588  {
4589  $this->debug("parse and process WSDL path=$wsdl");
4590  $this->wsdl = $wsdl;
4591  // parse wsdl file
4592  if ($this->wsdl != "") {
4593  $this->parseWSDL($this->wsdl);
4594  }
4595  // imports
4596  // TODO: handle imports more properly, grabbing them in-line and nesting them
4597  $imported_urls = array();
4598  $imported = 1;
4599  while ($imported > 0) {
4600  $imported = 0;
4601  // Schema imports
4602  foreach ($this->schemas as $ns => $list) {
4603  foreach ($list as $xs) {
4604  $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
4605  foreach ($xs->imports as $ns2 => $list2) {
4606  for ($ii = 0; $ii < count($list2); $ii++) {
4607  if (! $list2[$ii]['loaded']) {
4608  $this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true;
4609  $url = $list2[$ii]['location'];
4610  if ($url != '') {
4611  $urlparts = parse_url($url);
4612  if (!isset($urlparts['host'])) {
4613  $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' .$wsdlparts['port'] : '') .
4614  substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
4615  }
4616  if (! in_array($url, $imported_urls)) {
4617  $this->parseWSDL($url);
4618  $imported++;
4619  $imported_urls[] = $url;
4620  }
4621  } else {
4622  $this->debug("Unexpected scenario: empty URL for unloaded import");
4623  }
4624  }
4625  }
4626  }
4627  }
4628  }
4629  // WSDL imports
4630  $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
4631  foreach ($this->import as $ns => $list) {
4632  for ($ii = 0; $ii < count($list); $ii++) {
4633  if (! $list[$ii]['loaded']) {
4634  $this->import[$ns][$ii]['loaded'] = true;
4635  $url = $list[$ii]['location'];
4636  if ($url != '') {
4637  $urlparts = parse_url($url);
4638  if (!isset($urlparts['host'])) {
4639  $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') .
4640  substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
4641  }
4642  if (! in_array($url, $imported_urls)) {
4643  $this->parseWSDL($url);
4644  $imported++;
4645  $imported_urls[] = $url;
4646  }
4647  } else {
4648  $this->debug("Unexpected scenario: empty URL for unloaded import");
4649  }
4650  }
4651  }
4652  }
4653  }
4654  // add new data to operation data
4655  foreach($this->bindings as $binding => $bindingData) {
4656  if (isset($bindingData['operations']) && is_array($bindingData['operations'])) {
4657  foreach($bindingData['operations'] as $operation => $data) {
4658  $this->debug('post-parse data gathering for ' . $operation);
4659  $this->bindings[$binding]['operations'][$operation]['input'] =
4660  isset($this->bindings[$binding]['operations'][$operation]['input']) ?
4661  array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) :
4662  $this->portTypes[ $bindingData['portType'] ][$operation]['input'];
4663  $this->bindings[$binding]['operations'][$operation]['output'] =
4664  isset($this->bindings[$binding]['operations'][$operation]['output']) ?
4665  array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) :
4666  $this->portTypes[ $bindingData['portType'] ][$operation]['output'];
4667  if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ])){
4668  $this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ];
4669  }
4670  if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ])){
4671  $this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ];
4672  }
4673  // Set operation style if necessary, but do not override one already provided
4674  if (isset($bindingData['style']) && !isset($this->bindings[$binding]['operations'][$operation]['style'])) {
4675  $this->bindings[$binding]['operations'][$operation]['style'] = $bindingData['style'];
4676  }
4677  $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : '';
4678  $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : '';
4679  $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : '';
4680  }
4681  }
4682  }
4683  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
$wsdl
Definition: nusoap.php:3135
parses a WSDL file, allows access to it&#39;s data, other utility methods
Definition: nusoap.php:3133
parseWSDL($wsdl='')
parses the wsdl document
Definition: nusoap.php:3290
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
Create styles array
The data for the language used.
$url
$binding
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBindingData() [1/2]

wsdl::getBindingData (   $binding)

Definition at line 3635 of file nusoap.php.

References $binding.

3636  {
3637  if (is_array($this->bindings[$binding])) {
3638  return $this->bindings[$binding];
3639  }
3640  }
$binding

◆ getBindingData() [2/2]

wsdl::getBindingData (   $binding)

Definition at line 5067 of file nusoap.php.

References $binding.

5068  {
5069  if (is_array($this->bindings[$binding])) {
5070  return $this->bindings[$binding];
5071  }
5072  }
$binding

◆ getOperationData() [1/2]

wsdl::getOperationData (   $operation,
  $bindingType = 'soap' 
)

returns an associative array of data necessary for calling an operation

Parameters
string$operation,nameof operation
string$bindingType,typeof binding eg: soap
Returns
array public

Definition at line 3679 of file nusoap.php.

Referenced by soap_server\invoke_method(), nusoap_server\invoke_method(), soap_server\verify_method(), and nusoap_server\verify_method().

3680  {
3681  if ($bindingType == 'soap') {
3682  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
3683  }
3684  // loop thru ports
3685  foreach($this->ports as $port => $portData) {
3686  // binding type of port matches parameter
3687  if ($portData['bindingType'] == $bindingType) {
3688  // get binding
3689  //foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
3690  foreach(array_keys($this->bindings[ $portData['binding'] ]['operations']) as $bOperation) {
3691  if ($operation == $bOperation) {
3692  $opData = $this->bindings[ $portData['binding'] ]['operations'][$operation];
3693  return $opData;
3694  }
3695  }
3696  }
3697  }
3698  }
$opData
Definition: nusoap.php:3150
+ Here is the caller graph for this function:

◆ getOperationData() [2/2]

wsdl::getOperationData (   $operation,
  $bindingType = 'soap' 
)

returns an associative array of data necessary for calling an operation

Parameters
string$operationname of operation
string$bindingTypetype of binding eg: soap, soap12
Returns
array public

Definition at line 5112 of file nusoap.php.

5113  {
5114  if ($bindingType == 'soap') {
5115  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
5116  } elseif ($bindingType == 'soap12') {
5117  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
5118  }
5119  // loop thru ports
5120  foreach($this->ports as $port => $portData) {
5121  // binding type of port matches parameter
5122  if ($portData['bindingType'] == $bindingType) {
5123  // get binding
5124  //foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
5125  foreach(array_keys($this->bindings[ $portData['binding'] ]['operations']) as $bOperation) {
5126  // note that we could/should also check the namespace here
5127  if ($operation == $bOperation) {
5128  $opData = $this->bindings[ $portData['binding'] ]['operations'][$operation];
5129  return $opData;
5130  }
5131  }
5132  }
5133  }
5134  }
$opData
Definition: nusoap.php:3150

◆ getOperationDataForSoapAction()

wsdl::getOperationDataForSoapAction (   $soapAction,
  $bindingType = 'soap' 
)

returns an associative array of data necessary for calling an operation

Parameters
string$soapActionsoapAction for operation
string$bindingTypetype of binding eg: soap, soap12
Returns
array public

Definition at line 5144 of file nusoap.php.

Referenced by nusoap_server\invoke_method().

5144  {
5145  if ($bindingType == 'soap') {
5146  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
5147  } elseif ($bindingType == 'soap12') {
5148  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
5149  }
5150  // loop thru ports
5151  foreach($this->ports as $port => $portData) {
5152  // binding type of port matches parameter
5153  if ($portData['bindingType'] == $bindingType) {
5154  // loop through operations for the binding
5155  foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
5156  if ($opData['soapAction'] == $soapAction) {
5157  return $opData;
5158  }
5159  }
5160  }
5161  }
5162  }
$opData
Definition: nusoap.php:3150
+ Here is the caller graph for this function:

◆ getOperations() [1/2]

wsdl::getOperations (   $bindingType = 'soap')

returns an assoc array of operation names => operation data

Parameters
string$bindingTypeeg: soap, smtp, dime (only soap is currently supported)
Returns
array public

Definition at line 3649 of file nusoap.php.

References array.

Referenced by nusoap_client\checkWSDL(), soap_client\soap_client(), and soap_server\webDescription().

3650  {
3651  $ops = array();
3652  if ($bindingType == 'soap') {
3653  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
3654  }
3655  // loop thru ports
3656  foreach($this->ports as $port => $portData) {
3657  // binding type of port matches parameter
3658  if ($portData['bindingType'] == $bindingType) {
3659  //$this->debug("getOperations for port $port");
3660  //$this->debug("port data: " . $this->varDump($portData));
3661  //$this->debug("bindings: " . $this->varDump($this->bindings[ $portData['binding'] ]));
3662  // merge bindings
3663  if (isset($this->bindings[ $portData['binding'] ]['operations'])) {
3664  $ops = array_merge ($ops, $this->bindings[ $portData['binding'] ]['operations']);
3665  }
3666  }
3667  }
3668  return $ops;
3669  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getOperations() [2/2]

wsdl::getOperations (   $bindingType = 'soap')

returns an assoc array of operation names => operation data

Parameters
string$bindingTypeeg: soap, smtp, dime (only soap and soap12 are currently supported)
Returns
array public

Definition at line 5081 of file nusoap.php.

References array.

5081  {
5082  $ops = array();
5083  if ($bindingType == 'soap') {
5084  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
5085  } elseif ($bindingType == 'soap12') {
5086  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
5087  }
5088  // loop thru ports
5089  foreach($this->ports as $port => $portData) {
5090  // binding type of port matches parameter
5091  if ($portData['bindingType'] == $bindingType) {
5092  //$this->debug("getOperations for port $port");
5093  //$this->debug("port data: " . $this->varDump($portData));
5094  //$this->debug("bindings: " . $this->varDump($this->bindings[ $portData['binding'] ]));
5095  // merge bindings
5096  if (isset($this->bindings[ $portData['binding'] ]['operations'])) {
5097  $ops = array_merge ($ops, $this->bindings[ $portData['binding'] ]['operations']);
5098  }
5099  }
5100  }
5101  return $ops;
5102  }
Create styles array
The data for the language used.

◆ getTypeDef() [1/2]

wsdl::getTypeDef (   $type,
  $ns 
)

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 )

Parameters
$typestring
$nsstring
Returns
mixed public
See also
xmlschema

Definition at line 3718 of file nusoap.php.

References $t, and $type.

3718  {
3719  if ((! $ns) && isset($this->namespaces['tns'])) {
3720  $ns = $this->namespaces['tns'];
3721  }
3722  if (isset($this->schemas[$ns])) {
3723  foreach ($this->schemas[$ns] as $xs) {
3724  $t = $xs->getTypeDef($type);
3725  $this->debug_str .= $xs->debug_str;
3726  $xs->debug_str = '';
3727  if ($t) {
3728  return $t;
3729  }
3730  }
3731  }
3732  return false;
3733  }
$type

◆ getTypeDef() [2/2]

wsdl::getTypeDef (   $type,
  $ns 
)

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 )

Parameters
string$typethe type
string$nsnamespace (not prefix) of the type
Returns
mixed public
See also
nusoap_xmlschema

Definition at line 5182 of file nusoap.php.

References $i, $t, $type, nusoap_base\debug(), and nusoap_base\varDump().

5182  {
5183  $this->debug("in getTypeDef: type=$type, ns=$ns");
5184  if ((! $ns) && isset($this->namespaces['tns'])) {
5185  $ns = $this->namespaces['tns'];
5186  $this->debug("in getTypeDef: type namespace forced to $ns");
5187  }
5188  if (!isset($this->schemas[$ns])) {
5189  foreach ($this->schemas as $ns0 => $schema0) {
5190  if (strcasecmp($ns, $ns0) == 0) {
5191  $this->debug("in getTypeDef: replacing schema namespace $ns with $ns0");
5192  $ns = $ns0;
5193  break;
5194  }
5195  }
5196  }
5197  if (isset($this->schemas[$ns])) {
5198  $this->debug("in getTypeDef: have schema for namespace $ns");
5199  for ($i = 0; $i < count($this->schemas[$ns]); $i++) {
5200  $xs = &$this->schemas[$ns][$i];
5201  $t = $xs->getTypeDef($type);
5202  //$this->appendDebug($xs->getDebug());
5203  //$xs->clearDebug();
5204  if ($t) {
5205  if (!isset($t['phpType'])) {
5206  // get info for type to tack onto the element
5207  $uqType = substr($t['type'], strrpos($t['type'], ':') + 1);
5208  $ns = substr($t['type'], 0, strrpos($t['type'], ':'));
5209  $etype = $this->getTypeDef($uqType, $ns);
5210  if ($etype) {
5211  $this->debug("found type for [element] $type:");
5212  $this->debug($this->varDump($etype));
5213  if (isset($etype['phpType'])) {
5214  $t['phpType'] = $etype['phpType'];
5215  }
5216  if (isset($etype['elements'])) {
5217  $t['elements'] = $etype['elements'];
5218  }
5219  if (isset($etype['attrs'])) {
5220  $t['attrs'] = $etype['attrs'];
5221  }
5222  }
5223  }
5224  return $t;
5225  }
5226  }
5227  } else {
5228  $this->debug("in getTypeDef: do not have schema for namespace $ns");
5229  }
5230  return false;
5231  }
getTypeDef($type, $ns)
returns an array of information about a given type returns false if no type exists by the given name ...
Definition: nusoap.php:3718
$type
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
varDump($data)
Definition: nusoap.php:567
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ parametersMatchWrapped()

wsdl::parametersMatchWrapped (   $type,
$parameters 
)

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

Parameters
string$typethe type (element name) of the wrapper
array$parametersthe parameter values for the SOAP call
Returns
boolean whether they parameters are unwrapped (and should be wrapped) private

Definition at line 5515 of file nusoap.php.

References $name, $type, nusoap_base\appendDebug(), nusoap_base\debug(), nusoap_base\getNamespaceFromPrefix(), nusoap_base\isArraySimpleOrStruct(), and nusoap_base\varDump().

5515  {
5516  $this->debug("in parametersMatchWrapped type=$type, parameters=");
5517  $this->appendDebug($this->varDump($parameters));
5518 
5519  // split type into namespace:unqualified-type
5520  if (strpos($type, ':')) {
5521  $uqType = substr($type, strrpos($type, ':') + 1);
5522  $ns = substr($type, 0, strrpos($type, ':'));
5523  $this->debug("in parametersMatchWrapped: got a prefixed type: $uqType, $ns");
5524  if ($this->getNamespaceFromPrefix($ns)) {
5525  $ns = $this->getNamespaceFromPrefix($ns);
5526  $this->debug("in parametersMatchWrapped: expanded prefixed type: $uqType, $ns");
5527  }
5528  } else {
5529  // TODO: should the type be compared to types in XSD, and the namespace
5530  // set to XSD if the type matches?
5531  $this->debug("in parametersMatchWrapped: No namespace for type $type");
5532  $ns = '';
5533  $uqType = $type;
5534  }
5535 
5536  // get the type information
5537  if (!$typeDef = $this->getTypeDef($uqType, $ns)) {
5538  $this->debug("in parametersMatchWrapped: $type ($uqType) is not a supported type.");
5539  return false;
5540  }
5541  $this->debug("in parametersMatchWrapped: found typeDef=");
5542  $this->appendDebug($this->varDump($typeDef));
5543  if (substr($uqType, -1) == '^') {
5544  $uqType = substr($uqType, 0, -1);
5545  }
5546  $phpType = $typeDef['phpType'];
5547  $arrayType = (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '');
5548  $this->debug("in parametersMatchWrapped: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: $arrayType");
5549 
5550  // we expect a complexType or element of complexType
5551  if ($phpType != 'struct') {
5552  $this->debug("in parametersMatchWrapped: not a struct");
5553  return false;
5554  }
5555 
5556  // see whether the parameter names match the elements
5557  if (isset($typeDef['elements']) && is_array($typeDef['elements'])) {
5558  $elements = 0;
5559  $matches = 0;
5560  $change = false;
5561  if ($this->isArraySimpleOrStruct($parameters) == 'arraySimple' && count($parameters) == count($typeDef['elements'])) {
5562  $this->debug("in parametersMatchWrapped: (wrapped return value kludge) correct number of elements in simple array, so change array and wrap");
5563  $change = true;
5564  }
5565  foreach ($typeDef['elements'] as $name => $attrs) {
5566  if ($change) {
5567  $this->debug("in parametersMatchWrapped: change parameter $element to name $name");
5568  $parameters[$name] = $parameters[$elements];
5569  unset($parameters[$elements]);
5570  $matches++;
5571  } elseif (isset($parameters[$name])) {
5572  $this->debug("in parametersMatchWrapped: have parameter named $name");
5573  $matches++;
5574  } else {
5575  $this->debug("in parametersMatchWrapped: do not have parameter named $name");
5576  }
5577  $elements++;
5578  }
5579 
5580  $this->debug("in parametersMatchWrapped: $matches parameter names match $elements wrapped parameter names");
5581  if ($matches == 0) {
5582  return false;
5583  }
5584  return true;
5585  }
5586 
5587  // since there are no elements for the type, if the user passed no
5588  // parameters, the parameters match wrapped.
5589  $this->debug("in parametersMatchWrapped: no elements type $ns:$uqType");
5590  return count($parameters) == 0;
5591  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:294
getTypeDef($type, $ns)
returns an array of information about a given type returns false if no type exists by the given name ...
Definition: nusoap.php:3718
isArraySimpleOrStruct($val)
detect if array is a simple array or a struct (associative array)
Definition: nusoap.php:195
$type
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
if($format !==null) $name
Definition: metadata.php:146
varDump($data)
Definition: nusoap.php:567
getNamespaceFromPrefix($prefix)
pass it a prefix, it returns a namespace returns false if no namespace registered with the given pref...
Definition: nusoap.php:541
+ Here is the call graph for this function:

◆ parseWSDL() [1/2]

wsdl::parseWSDL (   $wsdl = '')

parses the wsdl document

Parameters
string$wsdlpath or URL private

Definition at line 3290 of file nusoap.php.

References $data, nusoap_base\debug(), nusoap_base\getError(), and nusoap_base\setError().

3291  {
3292  if ($wsdl == '') {
3293  $this->debug('no wsdl passed to parseWSDL()!!');
3294  $this->setError('no wsdl passed to parseWSDL()!!');
3295  return false;
3296  }
3297 
3298  // parse $wsdl for url format
3299  $wsdl_props = parse_url($wsdl);
3300 
3301  if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'http' || $wsdl_props['scheme'] == 'https')) {
3302  $this->debug('getting WSDL http(s) URL ' . $wsdl);
3303  // get wsdl
3304  $tr = new soap_transport_http($wsdl);
3305  $tr->request_method = 'GET';
3306  $tr->useSOAPAction = false;
3307  if($this->proxyhost && $this->proxyport){
3308  $tr->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword);
3309  }
3310  if (isset($wsdl_props['user'])) {
3311  $tr->setCredentials($wsdl_props['user'],$wsdl_props['pass']);
3312  }
3313  $wsdl_string = $tr->send('', $this->timeout, $this->response_timeout);
3314  //$this->debug("WSDL request\n" . $tr->outgoing_payload);
3315  //$this->debug("WSDL response\n" . $tr->incoming_payload);
3316  $this->debug("transport debug data...\n" . $tr->debug_str);
3317  // catch errors
3318  if($err = $tr->getError() ){
3319  $errstr = 'HTTP ERROR: '.$err;
3320  $this->debug($errstr);
3321  $this->setError($errstr);
3322  unset($tr);
3323  return false;
3324  }
3325  unset($tr);
3326  } else {
3327  // $wsdl is not http(s), so treat it as a file URL or plain file path
3328  if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'file') && isset($wsdl_props['path'])) {
3329  $path = isset($wsdl_props['host']) ? ($wsdl_props['host'] . ':' . $wsdl_props['path']) : $wsdl_props['path'];
3330  } else {
3331  $path = $wsdl;
3332  }
3333  $this->debug('getting WSDL file ' . $path);
3334  if ($fp = @fopen($path, 'r')) {
3335  $wsdl_string = '';
3336  while ($data = fread($fp, 32768)) {
3337  $wsdl_string .= $data;
3338  }
3339  fclose($fp);
3340  } else {
3341  $errstr = "Bad path to WSDL file $path";
3342  $this->debug($errstr);
3343  $this->setError($errstr);
3344  return false;
3345  }
3346  }
3347  // end new code added
3348  // Create an XML parser.
3349  $this->parser = xml_parser_create();
3350  // Set the options for parsing the XML data.
3351  // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
3352  xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
3353  // Set the object for the parser.
3354  xml_set_object($this->parser, $this);
3355  // Set the element handlers for the parser.
3356  xml_set_element_handler($this->parser, 'start_element', 'end_element');
3357  xml_set_character_data_handler($this->parser, 'character_data');
3358  // Parse the XML file.
3359  if (!xml_parse($this->parser, $wsdl_string, true)) {
3360  // Display an error message.
3361  $errstr = sprintf(
3362  'XML error parsing WSDL from %s on line %d: %s',
3363  $wsdl,
3364  xml_get_current_line_number($this->parser),
3365  xml_error_string(xml_get_error_code($this->parser))
3366  );
3367  $this->debug($errstr);
3368  $this->debug("XML payload:\n" . $wsdl_string);
3369  $this->setError($errstr);
3370  return false;
3371  }
3372  // free the parser
3373  xml_parser_free($this->parser);
3374  // catch wsdl parse errors
3375  if($this->getError()){
3376  return false;
3377  }
3378  return true;
3379  }
setError($str)
sets error string
Definition: nusoap.php:184
$wsdl
Definition: nusoap.php:3135
transport class for sending/receiving data via HTTP and HTTPS NOTE: PHP must be compiled with the CUR...
Definition: nusoap.php:1552
getError()
returns error string if present
Definition: nusoap.php:171
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
+ Here is the call graph for this function:

◆ parseWSDL() [2/2]

wsdl::parseWSDL (   $wsdl = '')

parses the wsdl document

Parameters
string$wsdlpath or URL private

Definition at line 4691 of file nusoap.php.

References $data, nusoap_base\appendDebug(), array, nusoap_base\debug(), nusoap_base\getError(), and nusoap_base\setError().

4691  {
4692  $this->debug("parse WSDL at path=$wsdl");
4693 
4694  if ($wsdl == '') {
4695  $this->debug('no wsdl passed to parseWSDL()!!');
4696  $this->setError('no wsdl passed to parseWSDL()!!');
4697  return false;
4698  }
4699 
4700  // parse $wsdl for url format
4701  $wsdl_props = parse_url($wsdl);
4702 
4703  if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'http' || $wsdl_props['scheme'] == 'https')) {
4704  $this->debug('getting WSDL http(s) URL ' . $wsdl);
4705  // get wsdl
4706  $tr = new soap_transport_http($wsdl, $this->curl_options, $this->use_curl);
4707  $tr->request_method = 'GET';
4708  $tr->useSOAPAction = false;
4709  if($this->proxyhost && $this->proxyport){
4710  $tr->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword);
4711  }
4712  if ($this->authtype != '') {
4713  $tr->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
4714  }
4715  $tr->setEncoding('gzip, deflate');
4716  $wsdl_string = $tr->send('', $this->timeout, $this->response_timeout);
4717  //$this->debug("WSDL request\n" . $tr->outgoing_payload);
4718  //$this->debug("WSDL response\n" . $tr->incoming_payload);
4719  $this->appendDebug($tr->getDebug());
4720  // catch errors
4721  if($err = $tr->getError() ){
4722  $errstr = 'HTTP ERROR: '.$err;
4723  $this->debug($errstr);
4724  $this->setError($errstr);
4725  unset($tr);
4726  return false;
4727  }
4728  unset($tr);
4729  $this->debug("got WSDL URL");
4730  } else {
4731  // $wsdl is not http(s), so treat it as a file URL or plain file path
4732  if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'file') && isset($wsdl_props['path'])) {
4733  $path = isset($wsdl_props['host']) ? ($wsdl_props['host'] . ':' . $wsdl_props['path']) : $wsdl_props['path'];
4734  } else {
4735  $path = $wsdl;
4736  }
4737  $this->debug('getting WSDL file ' . $path);
4738  if ($fp = @fopen($path, 'r')) {
4739  $wsdl_string = '';
4740  while ($data = fread($fp, 32768)) {
4741  $wsdl_string .= $data;
4742  }
4743  fclose($fp);
4744  } else {
4745  $errstr = "Bad path to WSDL file $path";
4746  $this->debug($errstr);
4747  $this->setError($errstr);
4748  return false;
4749  }
4750  }
4751  $this->debug('Parse WSDL');
4752  // end new code added
4753  // Create an XML parser.
4754  $this->parser = xml_parser_create();
4755  // Set the options for parsing the XML data.
4756  // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
4757  xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
4758  // Set the object for the parser.
4759  xml_set_object($this->parser, $this);
4760  // Set the element handlers for the parser.
4761  xml_set_element_handler($this->parser, 'start_element', 'end_element');
4762  xml_set_character_data_handler($this->parser, 'character_data');
4763  // Parse the XML file.
4764  if (!xml_parse($this->parser, $wsdl_string, true)) {
4765  // Display an error message.
4766  $errstr = sprintf(
4767  'XML error parsing WSDL from %s on line %d: %s',
4768  $wsdl,
4769  xml_get_current_line_number($this->parser),
4770  xml_error_string(xml_get_error_code($this->parser))
4771  );
4772  $this->debug($errstr);
4773  $this->debug("XML payload:\n" . $wsdl_string);
4774  $this->setError($errstr);
4775  return false;
4776  }
4777  // free the parser
4778  xml_parser_free($this->parser);
4779  $this->debug('Parsing WSDL done');
4780  // catch wsdl parse errors
4781  if($this->getError()){
4782  return false;
4783  }
4784  return true;
4785  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:294
setError($str)
sets error string
Definition: nusoap.php:184
$wsdl
Definition: nusoap.php:3135
transport class for sending/receiving data via HTTP and HTTPS NOTE: PHP must be compiled with the CUR...
Definition: nusoap.php:1552
getError()
returns error string if present
Definition: nusoap.php:171
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ serialize() [1/2]

wsdl::serialize ( )

serialize the parsed wsdl

Returns
string , serialization of WSDL public

Definition at line 3741 of file nusoap.php.

References $list, nusoap_base\getLocalPart(), nusoap_base\getPrefix(), and nusoap_base\getPrefixFromNamespace().

Referenced by soap_server\service(), and nusoap_server\service().

3742  {
3743  $xml = '<?xml version="1.0" encoding="ISO-8859-1"?><definitions';
3744  foreach($this->namespaces as $k => $v) {
3745  $xml .= " xmlns:$k=\"$v\"";
3746  }
3747  // 10.9.02 - add poulter fix for wsdl and tns declarations
3748  if (isset($this->namespaces['wsdl'])) {
3749  $xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\"";
3750  }
3751  if (isset($this->namespaces['tns'])) {
3752  $xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\"";
3753  }
3754  $xml .= '>';
3755  // imports
3756  if (sizeof($this->import) > 0) {
3757  foreach($this->import as $ns => $list) {
3758  foreach ($list as $ii) {
3759  if ($ii['location'] != '') {
3760  $xml .= '<import location="' . $ii['location'] . '" namespace="' . $ns . '" />';
3761  } else {
3762  $xml .= '<import namespace="' . $ns . '" />';
3763  }
3764  }
3765  }
3766  }
3767  // types
3768  if (count($this->schemas)>=1) {
3769  $xml .= '<types>';
3770  foreach ($this->schemas as $ns => $list) {
3771  foreach ($list as $xs) {
3772  $xml .= $xs->serializeSchema();
3773  }
3774  }
3775  $xml .= '</types>';
3776  }
3777  // messages
3778  if (count($this->messages) >= 1) {
3779  foreach($this->messages as $msgName => $msgParts) {
3780  $xml .= '<message name="' . $msgName . '">';
3781  if(is_array($msgParts)){
3782  foreach($msgParts as $partName => $partType) {
3783  // print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'<br>';
3784  if (strpos($partType, ':')) {
3785  $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType));
3786  } elseif (isset($this->typemap[$this->namespaces['xsd']][$partType])) {
3787  // print 'checking typemap: '.$this->XMLSchemaVersion.'<br>';
3788  $typePrefix = 'xsd';
3789  } else {
3790  foreach($this->typemap as $ns => $types) {
3791  if (isset($types[$partType])) {
3792  $typePrefix = $this->getPrefixFromNamespace($ns);
3793  }
3794  }
3795  if (!isset($typePrefix)) {
3796  die("$partType has no namespace!");
3797  }
3798  }
3799  $xml .= '<part name="' . $partName . '" type="' . $typePrefix . ':' . $this->getLocalPart($partType) . '" />';
3800  }
3801  }
3802  $xml .= '</message>';
3803  }
3804  }
3805  // bindings & porttypes
3806  if (count($this->bindings) >= 1) {
3807  $binding_xml = '';
3808  $portType_xml = '';
3809  foreach($this->bindings as $bindingName => $attrs) {
3810  $binding_xml .= '<binding name="' . $bindingName . '" type="tns:' . $attrs['portType'] . '">';
3811  $binding_xml .= '<soap:binding style="' . $attrs['style'] . '" transport="' . $attrs['transport'] . '"/>';
3812  $portType_xml .= '<portType name="' . $attrs['portType'] . '">';
3813  foreach($attrs['operations'] as $opName => $opParts) {
3814  $binding_xml .= '<operation name="' . $opName . '">';
3815  $binding_xml .= '<soap:operation soapAction="' . $opParts['soapAction'] . '" style="'. $attrs['style'] . '"/>';
3816  if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') {
3817  $enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
3818  } else {
3819  $enc_style = '';
3820  }
3821  $binding_xml .= '<input><soap:body use="' . $opParts['input']['use'] . '" namespace="' . $opParts['input']['namespace'] . '"' . $enc_style . '/></input>';
3822  if (isset($opParts['output']['encodingStyle']) && $opParts['output']['encodingStyle'] != '') {
3823  $enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"';
3824  } else {
3825  $enc_style = '';
3826  }
3827  $binding_xml .= '<output><soap:body use="' . $opParts['output']['use'] . '" namespace="' . $opParts['output']['namespace'] . '"' . $enc_style . '/></output>';
3828  $binding_xml .= '</operation>';
3829  $portType_xml .= '<operation name="' . $opParts['name'] . '"';
3830  if (isset($opParts['parameterOrder'])) {
3831  $portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"';
3832  }
3833  $portType_xml .= '>';
3834  if(isset($opParts['documentation']) && $opParts['documentation'] != '') {
3835  $portType_xml .= '<documentation>' . htmlspecialchars($opParts['documentation']) . '</documentation>';
3836  }
3837  $portType_xml .= '<input message="tns:' . $opParts['input']['message'] . '"/>';
3838  $portType_xml .= '<output message="tns:' . $opParts['output']['message'] . '"/>';
3839  $portType_xml .= '</operation>';
3840  }
3841  $portType_xml .= '</portType>';
3842  $binding_xml .= '</binding>';
3843  }
3844  $xml .= $portType_xml . $binding_xml;
3845  }
3846  // services
3847  $xml .= '<service name="' . $this->serviceName . '">';
3848  if (count($this->ports) >= 1) {
3849  foreach($this->ports as $pName => $attrs) {
3850  $xml .= '<port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">';
3851  $xml .= '<soap:address location="' . $attrs['location'] . '"/>';
3852  $xml .= '</port>';
3853  }
3854  }
3855  $xml .= '</service>';
3856  return $xml . '</definitions>';
3857  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
$xml
Definition: metadata.php:240
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:557
getPrefix($str)
returns the prefix part of a prefixed string returns false, if not prefixed
Definition: nusoap.php:525
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize() [2/2]

wsdl::serialize (   $debug = 0)

serialize the parsed wsdl

Parameters
mixed$debugwhether to put debug=1 in endpoint URL
Returns
string serialization of WSDL public

Definition at line 5371 of file nusoap.php.

References $_GET, $debug, $list, nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), nusoap_base\getPrefix(), and nusoap_base\getPrefixFromNamespace().

5372  {
5373  $xml = '<?xml version="1.0" encoding="ISO-8859-1"?>';
5374  $xml .= "\n<definitions";
5375  foreach($this->namespaces as $k => $v) {
5376  $xml .= " xmlns:$k=\"$v\"";
5377  }
5378  // 10.9.02 - add poulter fix for wsdl and tns declarations
5379  if (isset($this->namespaces['wsdl'])) {
5380  $xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\"";
5381  }
5382  if (isset($this->namespaces['tns'])) {
5383  $xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\"";
5384  }
5385  $xml .= '>';
5386  // imports
5387  if (sizeof($this->import) > 0) {
5388  foreach($this->import as $ns => $list) {
5389  foreach ($list as $ii) {
5390  if ($ii['location'] != '') {
5391  $xml .= '<import location="' . $ii['location'] . '" namespace="' . $ns . '" />';
5392  } else {
5393  $xml .= '<import namespace="' . $ns . '" />';
5394  }
5395  }
5396  }
5397  }
5398  // types
5399  if (count($this->schemas)>=1) {
5400  $xml .= "\n<types>\n";
5401  foreach ($this->schemas as $ns => $list) {
5402  foreach ($list as $xs) {
5403  $xml .= $xs->serializeSchema();
5404  }
5405  }
5406  $xml .= '</types>';
5407  }
5408  // messages
5409  if (count($this->messages) >= 1) {
5410  foreach($this->messages as $msgName => $msgParts) {
5411  $xml .= "\n<message name=\"" . $msgName . '">';
5412  if(is_array($msgParts)){
5413  foreach($msgParts as $partName => $partType) {
5414  // print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'<br>';
5415  if (strpos($partType, ':')) {
5416  $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType));
5417  } elseif (isset($this->typemap[$this->namespaces['xsd']][$partType])) {
5418  // print 'checking typemap: '.$this->XMLSchemaVersion.'<br>';
5419  $typePrefix = 'xsd';
5420  } else {
5421  foreach($this->typemap as $ns => $types) {
5422  if (isset($types[$partType])) {
5423  $typePrefix = $this->getPrefixFromNamespace($ns);
5424  }
5425  }
5426  if (!isset($typePrefix)) {
5427  die("$partType has no namespace!");
5428  }
5429  }
5430  $ns = $this->getNamespaceFromPrefix($typePrefix);
5431  $localPart = $this->getLocalPart($partType);
5432  $typeDef = $this->getTypeDef($localPart, $ns);
5433  if ($typeDef['typeClass'] == 'element') {
5434  $elementortype = 'element';
5435  if (substr($localPart, -1) == '^') {
5436  $localPart = substr($localPart, 0, -1);
5437  }
5438  } else {
5439  $elementortype = 'type';
5440  }
5441  $xml .= "\n" . ' <part name="' . $partName . '" ' . $elementortype . '="' . $typePrefix . ':' . $localPart . '" />';
5442  }
5443  }
5444  $xml .= '</message>';
5445  }
5446  }
5447  // bindings & porttypes
5448  if (count($this->bindings) >= 1) {
5449  $binding_xml = '';
5450  $portType_xml = '';
5451  foreach($this->bindings as $bindingName => $attrs) {
5452  $binding_xml .= "\n<binding name=\"" . $bindingName . '" type="tns:' . $attrs['portType'] . '">';
5453  $binding_xml .= "\n" . ' <soap:binding style="' . $attrs['style'] . '" transport="' . $attrs['transport'] . '"/>';
5454  $portType_xml .= "\n<portType name=\"" . $attrs['portType'] . '">';
5455  foreach($attrs['operations'] as $opName => $opParts) {
5456  $binding_xml .= "\n" . ' <operation name="' . $opName . '">';
5457  $binding_xml .= "\n" . ' <soap:operation soapAction="' . $opParts['soapAction'] . '" style="'. $opParts['style'] . '"/>';
5458  if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') {
5459  $enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
5460  } else {
5461  $enc_style = '';
5462  }
5463  $binding_xml .= "\n" . ' <input><soap:body use="' . $opParts['input']['use'] . '" namespace="' . $opParts['input']['namespace'] . '"' . $enc_style . '/></input>';
5464  if (isset($opParts['output']['encodingStyle']) && $opParts['output']['encodingStyle'] != '') {
5465  $enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"';
5466  } else {
5467  $enc_style = '';
5468  }
5469  $binding_xml .= "\n" . ' <output><soap:body use="' . $opParts['output']['use'] . '" namespace="' . $opParts['output']['namespace'] . '"' . $enc_style . '/></output>';
5470  $binding_xml .= "\n" . ' </operation>';
5471  $portType_xml .= "\n" . ' <operation name="' . $opParts['name'] . '"';
5472  if (isset($opParts['parameterOrder'])) {
5473  $portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"';
5474  }
5475  $portType_xml .= '>';
5476  if(isset($opParts['documentation']) && $opParts['documentation'] != '') {
5477  $portType_xml .= "\n" . ' <documentation>' . htmlspecialchars($opParts['documentation']) . '</documentation>';
5478  }
5479  $portType_xml .= "\n" . ' <input message="tns:' . $opParts['input']['message'] . '"/>';
5480  $portType_xml .= "\n" . ' <output message="tns:' . $opParts['output']['message'] . '"/>';
5481  $portType_xml .= "\n" . ' </operation>';
5482  }
5483  $portType_xml .= "\n" . '</portType>';
5484  $binding_xml .= "\n" . '</binding>';
5485  }
5486  $xml .= $portType_xml . $binding_xml;
5487  }
5488  // services
5489  $xml .= "\n<service name=\"" . $this->serviceName . '">';
5490  $has_client = isset($_GET['client_id']);
5491  if (count($this->ports) >= 1) {
5492  foreach($this->ports as $pName => $attrs) {
5493  $xml .= "\n" . ' <port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">';
5494  $address = $attrs['location'] . ($debug || $has_client ? "?" : "")
5495  . ($debug ? 'debug=1' : '') . ($debug && $has_client ? "&amp;" : "")
5496  . ($has_client ? 'client_id=' . $_GET['client_id'] : '');
5497  $xml .= "\n" . ' <soap:address location="' . $address. '"/>';
5498  $xml .= "\n" . ' </port>';
5499  }
5500  }
5501 
5502  $xml .= "\n" . '</service>';
5503  return $xml . "\n</definitions>";
5504  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
getTypeDef($type, $ns)
returns an array of information about a given type returns false if no type exists by the given name ...
Definition: nusoap.php:3718
$_GET["client_id"]
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
$xml
Definition: metadata.php:240
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:557
getPrefix($str)
returns the prefix part of a prefixed string returns false, if not prefixed
Definition: nusoap.php:525
$debug
Definition: loganalyzer.php:16
getNamespaceFromPrefix($prefix)
pass it a prefix, it returns a namespace returns false if no namespace registered with the given pref...
Definition: nusoap.php:541
+ Here is the call graph for this function:

◆ serializeComplexTypeAttributes()

wsdl::serializeComplexTypeAttributes (   $typeDef,
  $value,
  $ns,
  $uqType 
)

serializes the attributes for a complexType

Parameters
array$typeDefour internal representation of an XML schema type (or element)
mixed$valuea native PHP value (parameter value)
string$nsthe namespace of the type
string$uqTypethe local part of the type
Returns
string value serialized as an XML string private

Definition at line 6085 of file nusoap.php.

References $xml, array, nusoap_base\debug(), nusoap_base\expandEntities(), nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), and nusoap_base\getPrefix().

6085  {
6086  $xml = '';
6087  if (isset($typeDef['attrs']) && is_array($typeDef['attrs'])) {
6088  $this->debug("serialize attributes for XML Schema type $ns:$uqType");
6089  if (is_array($value)) {
6090  $xvalue = $value;
6091  } elseif (is_object($value)) {
6092  $xvalue = get_object_vars($value);
6093  } else {
6094  $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
6095  $xvalue = array();
6096  }
6097  foreach ($typeDef['attrs'] as $aName => $attrs) {
6098  if (isset($xvalue['!' . $aName])) {
6099  $xname = '!' . $aName;
6100  $this->debug("value provided for attribute $aName with key $xname");
6101  } elseif (isset($xvalue[$aName])) {
6102  $xname = $aName;
6103  $this->debug("value provided for attribute $aName with key $xname");
6104  } elseif (isset($attrs['default'])) {
6105  $xname = '!' . $aName;
6106  $xvalue[$xname] = $attrs['default'];
6107  $this->debug('use default value of ' . $xvalue[$aName] . ' for attribute ' . $aName);
6108  } else {
6109  $xname = '';
6110  $this->debug("no value provided for attribute $aName");
6111  }
6112  if ($xname) {
6113  $xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\"";
6114  }
6115  }
6116  } else {
6117  $this->debug("no attributes to serialize for XML Schema type $ns:$uqType");
6118  }
6119  if (isset($typeDef['extensionBase'])) {
6120  $ns = $this->getPrefix($typeDef['extensionBase']);
6121  $uqType = $this->getLocalPart($typeDef['extensionBase']);
6122  if ($this->getNamespaceFromPrefix($ns)) {
6123  $ns = $this->getNamespaceFromPrefix($ns);
6124  }
6125  if ($typeDef = $this->getTypeDef($uqType, $ns)) {
6126  $this->debug("serialize attributes for extension base $ns:$uqType");
6127  $xml .= $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
6128  } else {
6129  $this->debug("extension base $ns:$uqType is not a supported type");
6130  }
6131  }
6132  return $xml;
6133  }
getTypeDef($type, $ns)
returns an array of information about a given type returns false if no type exists by the given name ...
Definition: nusoap.php:3718
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$xml
Definition: metadata.php:240
Create styles array
The data for the language used.
getPrefix($str)
returns the prefix part of a prefixed string returns false, if not prefixed
Definition: nusoap.php:525
expandEntities($val)
expands entities, e.g.
Definition: nusoap.php:154
serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType)
serializes the attributes for a complexType
Definition: nusoap.php:6085
getNamespaceFromPrefix($prefix)
pass it a prefix, it returns a namespace returns false if no namespace registered with the given pref...
Definition: nusoap.php:541
+ Here is the call graph for this function:

◆ serializeComplexTypeElements()

wsdl::serializeComplexTypeElements (   $typeDef,
  $value,
  $ns,
  $uqType,
  $use = 'encoded',
  $encodingStyle = false 
)

serializes the elements for a complexType

Parameters
array$typeDefour internal representation of an XML schema type (or element)
mixed$valuea native PHP value (parameter value)
string$nsthe namespace of the type
string$uqTypethe local part of the type
string$useuse for part (encoded|literal)
string$encodingStyleSOAP encoding style for the value (if different than the enclosing style)
Returns
string value serialized as an XML string private

Definition at line 6147 of file nusoap.php.

References $xml, array, nusoap_base\debug(), nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), nusoap_base\getPrefix(), nusoap_base\isArraySimpleOrStruct(), and nusoap_base\serialize_val().

6147  {
6148  $xml = '';
6149  if (isset($typeDef['elements']) && is_array($typeDef['elements'])) {
6150  $this->debug("in serializeComplexTypeElements, serialize elements for XML Schema type $ns:$uqType");
6151  if (is_array($value)) {
6152  $xvalue = $value;
6153  } elseif (is_object($value)) {
6154  $xvalue = get_object_vars($value);
6155  } else {
6156  $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
6157  $xvalue = array();
6158  }
6159  // toggle whether all elements are present - ideally should validate against schema
6160  if (count($typeDef['elements']) != count($xvalue)){
6161  $optionals = true;
6162  }
6163  foreach ($typeDef['elements'] as $eName => $attrs) {
6164  if (!isset($xvalue[$eName])) {
6165  if (isset($attrs['default'])) {
6166  $xvalue[$eName] = $attrs['default'];
6167  $this->debug('use default value of ' . $xvalue[$eName] . ' for element ' . $eName);
6168  }
6169  }
6170  // if user took advantage of a minOccurs=0, then only serialize named parameters
6171  if (isset($optionals)
6172  && (!isset($xvalue[$eName]))
6173  && ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
6174  ){
6175  if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') {
6176  $this->debug("apparent error: no value provided for element $eName with minOccurs=" . $attrs['minOccurs']);
6177  }
6178  // do nothing
6179  $this->debug("no value provided for complexType element $eName and element is not nillable, so serialize nothing");
6180  } else {
6181  // get value
6182  if (isset($xvalue[$eName])) {
6183  $v = $xvalue[$eName];
6184  } else {
6185  $v = null;
6186  }
6187  if (isset($attrs['form'])) {
6188  $unqualified = ($attrs['form'] == 'unqualified');
6189  } else {
6190  $unqualified = false;
6191  }
6192  if (isset($attrs['maxOccurs']) && ($attrs['maxOccurs'] == 'unbounded' || $attrs['maxOccurs'] > 1) && isset($v) && is_array($v) && $this->isArraySimpleOrStruct($v) == 'arraySimple') {
6193  $vv = $v;
6194  foreach ($vv as $k => $v) {
6195  if (isset($attrs['type']) || isset($attrs['ref'])) {
6196  // serialize schema-defined type
6197  $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
6198  } else {
6199  // serialize generic type (can this ever really happen?)
6200  $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
6201  $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
6202  }
6203  }
6204  } else {
6205  if (isset($attrs['type']) || isset($attrs['ref'])) {
6206  // serialize schema-defined type
6207  $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
6208  } else {
6209  // serialize generic type (can this ever really happen?)
6210  $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
6211  $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
6212  }
6213  }
6214  }
6215  }
6216  } else {
6217  $this->debug("no elements to serialize for XML Schema type $ns:$uqType");
6218  }
6219  if (isset($typeDef['extensionBase'])) {
6220  $ns = $this->getPrefix($typeDef['extensionBase']);
6221  $uqType = $this->getLocalPart($typeDef['extensionBase']);
6222  if ($this->getNamespaceFromPrefix($ns)) {
6223  $ns = $this->getNamespaceFromPrefix($ns);
6224  }
6225  if ($typeDef = $this->getTypeDef($uqType, $ns)) {
6226  $this->debug("serialize elements for extension base $ns:$uqType");
6227  $xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle);
6228  } else {
6229  $this->debug("extension base $ns:$uqType is not a supported type");
6230  }
6231  }
6232  return $xml;
6233  }
serializeType($name, $type, $value, $use='encoded', $encodingStyle=false)
serializes a PHP value according a given type definition
Definition: nusoap.php:4020
getTypeDef($type, $ns)
returns an array of information about a given type returns false if no type exists by the given name ...
Definition: nusoap.php:3718
isArraySimpleOrStruct($val)
detect if array is a simple array or a struct (associative array)
Definition: nusoap.php:195
serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false)
serializes the elements for a complexType
Definition: nusoap.php:6147
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$xml
Definition: metadata.php:240
serialize_val($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded')
serializes PHP values in accordance w/ section 5.
Definition: nusoap.php:212
Create styles array
The data for the language used.
getPrefix($str)
returns the prefix part of a prefixed string returns false, if not prefixed
Definition: nusoap.php:525
getNamespaceFromPrefix($prefix)
pass it a prefix, it returns a namespace returns false if no namespace registered with the given pref...
Definition: nusoap.php:541
+ Here is the call graph for this function:

◆ serializeParameters() [1/2]

wsdl::serializeParameters (   $operation,
  $direction,
  $parameters 
)

serialize a PHP value according to a WSDL message definition

TODO

  • multi-ref serialization
  • validate PHP values against type definitions, return errors if invalid
Parameters
string$ type name
mixed$ param value
Returns
mixed new param or false if initial value didn't validate

Definition at line 3945 of file nusoap.php.

References $name, $type, $xml, nusoap_base\debug(), nusoap_base\isArraySimpleOrStruct(), nusoap_base\setError(), and nusoap_base\varDump().

3946  {
3947  $this->debug('in serializeParameters with operation '.$operation.', direction '.$direction.' and '.count($parameters).' param(s), and xml schema version ' . $this->XMLSchemaVersion);
3948 
3949  if ($direction != 'input' && $direction != 'output') {
3950  $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
3951  $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
3952  return false;
3953  }
3954  if (!$opData = $this->getOperationData($operation)) {
3955  $this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
3956  $this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
3957  return false;
3958  }
3959  $this->debug($this->varDump($opData));
3960 
3961  // Get encoding style for output and set to current
3962  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
3963  if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
3964  $encodingStyle = $opData['output']['encodingStyle'];
3965  $enc_style = $encodingStyle;
3966  }
3967 
3968  // set input params
3969  $xml = '';
3970  if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
3971 
3972  $use = $opData[$direction]['use'];
3973  $this->debug("use=$use");
3974  $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
3975  if (is_array($parameters)) {
3976  $parametersArrayType = $this->isArraySimpleOrStruct($parameters);
3977  $this->debug('have ' . $parametersArrayType . ' parameters');
3978  foreach($opData[$direction]['parts'] as $name => $type) {
3979  $this->debug('serializing part "'.$name.'" of type "'.$type.'"');
3980  // Track encoding style
3981  if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
3982  $encodingStyle = $opData[$direction]['encodingStyle'];
3983  $enc_style = $encodingStyle;
3984  } else {
3985  $enc_style = false;
3986  }
3987  // NOTE: add error handling here
3988  // if serializeType returns false, then catch global error and fault
3989  if ($parametersArrayType == 'arraySimple') {
3990  $p = array_shift($parameters);
3991  $this->debug('calling serializeType w/indexed param');
3992  $xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
3993  } elseif (isset($parameters[$name])) {
3994  $this->debug('calling serializeType w/named param');
3995  $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
3996  } else {
3997  // TODO: only send nillable
3998  $this->debug('calling serializeType w/null param');
3999  $xml .= $this->serializeType($name, $type, null, $use, $enc_style);
4000  }
4001  }
4002  } else {
4003  $this->debug('no parameters passed.');
4004  }
4005  }
4006  return $xml;
4007  }
setError($str)
sets error string
Definition: nusoap.php:184
serializeType($name, $type, $value, $use='encoded', $encodingStyle=false)
serializes a PHP value according a given type definition
Definition: nusoap.php:4020
isArraySimpleOrStruct($val)
detect if array is a simple array or a struct (associative array)
Definition: nusoap.php:195
$type
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$xml
Definition: metadata.php:240
if($format !==null) $name
Definition: metadata.php:146
varDump($data)
Definition: nusoap.php:567
getOperationData($operation, $bindingType='soap')
returns an associative array of data necessary for calling an operation
Definition: nusoap.php:3679
$opData
Definition: nusoap.php:3150
+ Here is the call graph for this function:

◆ serializeParameters() [2/2]

wsdl::serializeParameters (   $operation,
  $direction,
  $parameters 
)

serialize a PHP value according to a WSDL message definition

TODO

  • multi-ref serialization
  • validate PHP values against type definitions, return errors if invalid
Parameters
string$operationoperation name
string$direction(input|output)
mixed$parametersparameter value(s)
Returns
mixed parameters serialized as XML or false on error (e.g. operation not found) public
Deprecated:

Definition at line 5702 of file nusoap.php.

References $name, $type, $xml, nusoap_base\appendDebug(), nusoap_base\debug(), nusoap_base\isArraySimpleOrStruct(), nusoap_base\setError(), and nusoap_base\varDump().

5703  {
5704  $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion");
5705  $this->appendDebug('parameters=' . $this->varDump($parameters));
5706 
5707  if ($direction != 'input' && $direction != 'output') {
5708  $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
5709  $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
5710  return false;
5711  }
5712  if (!$opData = $this->getOperationData($operation)) {
5713  $this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
5714  $this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
5715  return false;
5716  }
5717  $this->debug('opData:');
5718  $this->appendDebug($this->varDump($opData));
5719 
5720  // Get encoding style for output and set to current
5721  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
5722  if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
5723  $encodingStyle = $opData['output']['encodingStyle'];
5724  $enc_style = $encodingStyle;
5725  }
5726 
5727  // set input params
5728  $xml = '';
5729  if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
5730 
5731  $use = $opData[$direction]['use'];
5732  $this->debug("use=$use");
5733  $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
5734  if (is_array($parameters)) {
5735  $parametersArrayType = $this->isArraySimpleOrStruct($parameters);
5736  $this->debug('have ' . $parametersArrayType . ' parameters');
5737  foreach($opData[$direction]['parts'] as $name => $type) {
5738  $this->debug('serializing part "'.$name.'" of type "'.$type.'"');
5739  // Track encoding style
5740  if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
5741  $encodingStyle = $opData[$direction]['encodingStyle'];
5742  $enc_style = $encodingStyle;
5743  } else {
5744  $enc_style = false;
5745  }
5746  // NOTE: add error handling here
5747  // if serializeType returns false, then catch global error and fault
5748  if ($parametersArrayType == 'arraySimple') {
5749  $p = array_shift($parameters);
5750  $this->debug('calling serializeType w/indexed param');
5751  $xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
5752  } elseif (isset($parameters[$name])) {
5753  $this->debug('calling serializeType w/named param');
5754  $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
5755  } else {
5756  // TODO: only send nillable
5757  $this->debug('calling serializeType w/null param');
5758  $xml .= $this->serializeType($name, $type, null, $use, $enc_style);
5759  }
5760  }
5761  } else {
5762  $this->debug('no parameters passed.');
5763  }
5764  }
5765  $this->debug("serializeParameters returning: $xml");
5766  return $xml;
5767  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:294
setError($str)
sets error string
Definition: nusoap.php:184
serializeType($name, $type, $value, $use='encoded', $encodingStyle=false)
serializes a PHP value according a given type definition
Definition: nusoap.php:4020
isArraySimpleOrStruct($val)
detect if array is a simple array or a struct (associative array)
Definition: nusoap.php:195
$type
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$xml
Definition: metadata.php:240
if($format !==null) $name
Definition: metadata.php:146
varDump($data)
Definition: nusoap.php:567
getOperationData($operation, $bindingType='soap')
returns an associative array of data necessary for calling an operation
Definition: nusoap.php:3679
$opData
Definition: nusoap.php:3150
+ Here is the call graph for this function:

◆ serializeRPCParameters() [1/2]

wsdl::serializeRPCParameters (   $operation,
  $direction,
  $parameters 
)

serialize a PHP value according to a WSDL message definition

TODO

  • multi-ref serialization
  • validate PHP values against type definitions, return errors if invalid
Parameters
string$ type name
mixed$ param value
Returns
mixed new param or false if initial value didn't validate

Definition at line 3870 of file nusoap.php.

References $name, $type, $xml, nusoap_base\debug(), nusoap_base\isArraySimpleOrStruct(), nusoap_base\setError(), and nusoap_base\varDump().

Referenced by soap_client\call(), nusoap_client\call(), soap_server\serialize_return(), and nusoap_server\serialize_return().

3871  {
3872  $this->debug('in serializeRPCParameters with operation '.$operation.', direction '.$direction.' and '.count($parameters).' param(s), and xml schema version ' . $this->XMLSchemaVersion);
3873 
3874  if ($direction != 'input' && $direction != 'output') {
3875  $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
3876  $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
3877  return false;
3878  }
3879  if (!$opData = $this->getOperationData($operation)) {
3880  $this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
3881  $this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
3882  return false;
3883  }
3884  $this->debug($this->varDump($opData));
3885 
3886  // Get encoding style for output and set to current
3887  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
3888  if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
3889  $encodingStyle = $opData['output']['encodingStyle'];
3890  $enc_style = $encodingStyle;
3891  }
3892 
3893  // set input params
3894  $xml = '';
3895  if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
3896 
3897  $use = $opData[$direction]['use'];
3898  $this->debug("use=$use");
3899  $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
3900  if (is_array($parameters)) {
3901  $parametersArrayType = $this->isArraySimpleOrStruct($parameters);
3902  $this->debug('have ' . $parametersArrayType . ' parameters');
3903  foreach($opData[$direction]['parts'] as $name => $type) {
3904  $this->debug('serializing part "'.$name.'" of type "'.$type.'"');
3905  // Track encoding style
3906  if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
3907  $encodingStyle = $opData[$direction]['encodingStyle'];
3908  $enc_style = $encodingStyle;
3909  } else {
3910  $enc_style = false;
3911  }
3912  // NOTE: add error handling here
3913  // if serializeType returns false, then catch global error and fault
3914  if ($parametersArrayType == 'arraySimple') {
3915  $p = array_shift($parameters);
3916  $this->debug('calling serializeType w/indexed param');
3917  $xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
3918  } elseif (isset($parameters[$name])) {
3919  $this->debug('calling serializeType w/named param');
3920  $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
3921  } else {
3922  // TODO: only send nillable
3923  $this->debug('calling serializeType w/null param');
3924  $xml .= $this->serializeType($name, $type, null, $use, $enc_style);
3925  }
3926  }
3927  } else {
3928  $this->debug('no parameters passed.');
3929  }
3930  }
3931  return $xml;
3932  }
setError($str)
sets error string
Definition: nusoap.php:184
serializeType($name, $type, $value, $use='encoded', $encodingStyle=false)
serializes a PHP value according a given type definition
Definition: nusoap.php:4020
isArraySimpleOrStruct($val)
detect if array is a simple array or a struct (associative array)
Definition: nusoap.php:195
$type
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$xml
Definition: metadata.php:240
if($format !==null) $name
Definition: metadata.php:146
varDump($data)
Definition: nusoap.php:567
getOperationData($operation, $bindingType='soap')
returns an associative array of data necessary for calling an operation
Definition: nusoap.php:3679
$opData
Definition: nusoap.php:3150
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serializeRPCParameters() [2/2]

wsdl::serializeRPCParameters (   $operation,
  $direction,
  $parameters,
  $bindingType = 'soap' 
)

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
Parameters
string$operationoperation name
string$direction(input|output)
mixed$parametersparameter value(s)
string$bindingType(soap|soap12)
Returns
mixed parameters serialized as XML or false on error (e.g. operation not found) public

Definition at line 5608 of file nusoap.php.

References $name, $style, $type, $xml, nusoap_base\appendDebug(), array, nusoap_base\debug(), nusoap_base\isArraySimpleOrStruct(), nusoap_base\setError(), and nusoap_base\varDump().

5608  {
5609  $this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType");
5610  $this->appendDebug('parameters=' . $this->varDump($parameters));
5611 
5612  if ($direction != 'input' && $direction != 'output') {
5613  $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
5614  $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
5615  return false;
5616  }
5617  if (!$opData = $this->getOperationData($operation, $bindingType)) {
5618  $this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
5619  $this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
5620  return false;
5621  }
5622  $this->debug('in serializeRPCParameters: opData:');
5623  $this->appendDebug($this->varDump($opData));
5624 
5625  // Get encoding style for output and set to current
5626  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
5627  if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
5628  $encodingStyle = $opData['output']['encodingStyle'];
5629  $enc_style = $encodingStyle;
5630  }
5631 
5632  // set input params
5633  $xml = '';
5634  if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
5635  $parts = &$opData[$direction]['parts'];
5636  $part_count = sizeof($parts);
5637  $style = $opData['style'];
5638  $use = $opData[$direction]['use'];
5639  $this->debug("have $part_count part(s) to serialize using $style/$use");
5640  if (is_array($parameters)) {
5641  $parametersArrayType = $this->isArraySimpleOrStruct($parameters);
5642  $parameter_count = count($parameters);
5643  $this->debug("have $parameter_count parameter(s) provided as $parametersArrayType to serialize");
5644  // check for Microsoft-style wrapped parameters
5645  if ($style == 'document' && $use == 'literal' && $part_count == 1 && isset($parts['parameters'])) {
5646  $this->debug('check whether the caller has wrapped the parameters');
5647  if ((($parametersArrayType == 'arrayStruct' || $parameter_count == 0) && !isset($parameters['parameters'])) || ($direction == 'output' && $parametersArrayType == 'arraySimple' && $parameter_count == 1)) {
5648  $this->debug('check whether caller\'s parameters match the wrapped ones');
5649  if ($this->parametersMatchWrapped($parts['parameters'], $parameters)) {
5650  $this->debug('wrap the parameters for the caller');
5651  $parameters = array('parameters' => $parameters);
5652  $parameter_count = 1;
5653  }
5654  }
5655  }
5656  foreach ($parts as $name => $type) {
5657  $this->debug("serializing part $name of type $type");
5658  // Track encoding style
5659  if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
5660  $encodingStyle = $opData[$direction]['encodingStyle'];
5661  $enc_style = $encodingStyle;
5662  } else {
5663  $enc_style = false;
5664  }
5665  // NOTE: add error handling here
5666  // if serializeType returns false, then catch global error and fault
5667  if ($parametersArrayType == 'arraySimple') {
5668  $p = array_shift($parameters);
5669  $this->debug('calling serializeType w/indexed param');
5670  $xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
5671  } elseif (isset($parameters[$name])) {
5672  $this->debug('calling serializeType w/named param');
5673  $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
5674  } else {
5675  // TODO: only send nillable
5676  $this->debug('calling serializeType w/null param');
5677  $xml .= $this->serializeType($name, $type, null, $use, $enc_style);
5678  }
5679  }
5680  } else {
5681  $this->debug('no parameters passed.');
5682  }
5683  }
5684  $this->debug("serializeRPCParameters returning: $xml");
5685  return $xml;
5686  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:294
setError($str)
sets error string
Definition: nusoap.php:184
serializeType($name, $type, $value, $use='encoded', $encodingStyle=false)
serializes a PHP value according a given type definition
Definition: nusoap.php:4020
$style
Definition: example_012.php:70
isArraySimpleOrStruct($val)
detect if array is a simple array or a struct (associative array)
Definition: nusoap.php:195
$type
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$xml
Definition: metadata.php:240
if($format !==null) $name
Definition: metadata.php:146
Create styles array
The data for the language used.
varDump($data)
Definition: nusoap.php:567
getOperationData($operation, $bindingType='soap')
returns an associative array of data necessary for calling an operation
Definition: nusoap.php:3679
$opData
Definition: nusoap.php:3150
parametersMatchWrapped($type, &$parameters)
determine whether a set of parameters are unwrapped when they are expect to be wrapped, Microsoft-style.
Definition: nusoap.php:5515
+ Here is the call graph for this function:

◆ serializeType() [1/2]

wsdl::serializeType (   $name,
  $type,
  $value,
  $use = 'encoded',
  $encodingStyle = false 
)

serializes a PHP value according a given type definition

Parameters
string$name,nameof type (part)
string$type,typeof type, heh (type or element)
mixed$value,anative PHP value (parameter value)
string$use,usefor part (encoded|literal)
string$encodingStyle,useto add encoding changes to serialisation
Returns
string serialization public

Definition at line 4020 of file nusoap.php.

References $cols, $contents, $name, $rows, $type, $xml, array, nusoap_base\debug(), nusoap_base\expandEntities(), nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), nusoap_base\getPrefix(), nusoap_base\getPrefixFromNamespace(), nusoap_base\isArraySimpleOrStruct(), nusoap_base\serialize_val(), nusoap_base\setError(), and nusoap_base\varDump().

4021  {
4022  $this->debug("in serializeType: $name, $type, $value, $use, $encodingStyle");
4023  if($use == 'encoded' && $encodingStyle) {
4024  $encodingStyle = ' SOAP-ENV:encodingStyle="' . $encodingStyle . '"';
4025  }
4026 
4027  // if a soap_val has been supplied, let its type override the WSDL
4028  if (is_object($value) && get_class($value) == 'soapval') {
4029  // TODO: get attributes from soapval?
4030  if ($value->type_ns) {
4031  $type = $value->type_ns . ':' . $value->type;
4032  } else {
4033  $type = $value->type;
4034  }
4035  $value = $value->value;
4036  $forceType = true;
4037  $this->debug("in serializeType: soapval overrides type to $type, value to $value");
4038  } else {
4039  $forceType = false;
4040  }
4041 
4042  $xml = '';
4043  if (strpos($type, ':')) {
4044  $uqType = substr($type, strrpos($type, ':') + 1);
4045  $ns = substr($type, 0, strrpos($type, ':'));
4046  $this->debug("got a prefixed type: $uqType, $ns");
4047  if ($this->getNamespaceFromPrefix($ns)) {
4048  $ns = $this->getNamespaceFromPrefix($ns);
4049  $this->debug("expanded prefixed type: $uqType, $ns");
4050  }
4051 
4052  if($ns == $this->XMLSchemaVersion){
4053 
4054  if (is_null($value)) {
4055  if ($use == 'literal') {
4056  // TODO: depends on nillable
4057  return "<$name/>";
4058  } else {
4059  return "<$name xsi:nil=\"true\"/>";
4060  }
4061  }
4062  if ($uqType == 'boolean' && !$value) {
4063  $value = 'false';
4064  } elseif ($uqType == 'boolean') {
4065  $value = 'true';
4066  }
4067  if ($uqType == 'string' && gettype($value) == 'string') {
4068  $value = $this->expandEntities($value);
4069  }
4070  // it's a scalar
4071  // TODO: what about null/nil values?
4072  // check type isn't a custom type extending xmlschema namespace
4073  if (!$this->getTypeDef($uqType, $ns)) {
4074  if ($use == 'literal') {
4075  if ($forceType) {
4076  return "<$name xsi:type=\"" . $this->getPrefixFromNamespace($this->XMLSchemaVersion) . ":$uqType\">$value</$name>";
4077  } else {
4078  return "<$name>$value</$name>";
4079  }
4080  } else {
4081  return "<$name xsi:type=\"" . $this->getPrefixFromNamespace($this->XMLSchemaVersion) . ":$uqType\"$encodingStyle>$value</$name>";
4082  }
4083  }
4084  } else if ($ns == 'http://xml.apache.org/xml-soap') {
4085  if ($uqType == 'Map') {
4086  $contents = '';
4087  foreach($value as $k => $v) {
4088  $this->debug("serializing map element: key $k, value $v");
4089  $contents .= '<item>';
4090  $contents .= $this->serialize_val($k,'key',false,false,false,false,$use);
4091  $contents .= $this->serialize_val($v,'value',false,false,false,false,$use);
4092  $contents .= '</item>';
4093  }
4094  if ($use == 'literal') {
4095  if ($forceType) {
4096  return "<$name xsi:type=\"" . $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap') . ":$uqType\">$contents</$name>";
4097  } else {
4098  return "<$name>$contents</$name>";
4099  }
4100  } else {
4101  return "<$name xsi:type=\"" . $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap') . ":$uqType\"$encodingStyle>$contents</$name>";
4102  }
4103  }
4104  }
4105  } else {
4106  $this->debug("No namespace for type $type");
4107  $ns = '';
4108  $uqType = $type;
4109  }
4110  if(!$typeDef = $this->getTypeDef($uqType, $ns)){
4111  $this->setError("$type ($uqType) is not a supported type.");
4112  $this->debug("$type ($uqType) is not a supported type.");
4113  return false;
4114  } else {
4115  foreach($typeDef as $k => $v) {
4116  $this->debug("typedef, $k: $v");
4117  }
4118  }
4119  $phpType = $typeDef['phpType'];
4120  $this->debug("serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') );
4121  // if php type == struct, map value to the <all> element names
4122  if ($phpType == 'struct') {
4123  if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') {
4124  $elementName = $uqType;
4125  if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
4126  $elementNS = " xmlns=\"$ns\"";
4127  }
4128  } else {
4129  $elementName = $name;
4130  $elementNS = '';
4131  }
4132  if (is_null($value)) {
4133  if ($use == 'literal') {
4134  // TODO: depends on nillable
4135  return "<$elementName$elementNS/>";
4136  } else {
4137  return "<$elementName$elementNS xsi:nil=\"true\"/>";
4138  }
4139  }
4140  if ($use == 'literal') {
4141  if ($forceType) {
4142  $xml = "<$elementName$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">";
4143  } else {
4144  $xml = "<$elementName$elementNS>";
4145  }
4146  } else {
4147  $xml = "<$elementName$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>";
4148  }
4149 
4150  if (isset($typeDef['elements']) && is_array($typeDef['elements'])) {
4151  if (is_array($value)) {
4152  $xvalue = $value;
4153  } elseif (is_object($value)) {
4154  $xvalue = get_object_vars($value);
4155  } else {
4156  $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
4157  $xvalue = array();
4158  }
4159  // toggle whether all elements are present - ideally should validate against schema
4160  if(count($typeDef['elements']) != count($xvalue)){
4161  $optionals = true;
4162  }
4163  foreach($typeDef['elements'] as $eName => $attrs) {
4164  // if user took advantage of a minOccurs=0, then only serialize named parameters
4165  if(isset($optionals) && !isset($xvalue[$eName])){
4166  // do nothing
4167  } else {
4168  // get value
4169  if (isset($xvalue[$eName])) {
4170  $v = $xvalue[$eName];
4171  } else {
4172  $v = null;
4173  }
4174  // TODO: if maxOccurs > 1 (not just unbounded), then allow serialization of an array
4175  if (isset($attrs['maxOccurs']) && $attrs['maxOccurs'] == 'unbounded' && isset($v) && is_array($v) && $this->isArraySimpleOrStruct($v) == 'arraySimple') {
4176  $vv = $v;
4177  foreach ($vv as $k => $v) {
4178  if (isset($attrs['type'])) {
4179  // serialize schema-defined type
4180  $xml .= $this->serializeType($eName, $attrs['type'], $v, $use, $encodingStyle);
4181  } else {
4182  // serialize generic type
4183  $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
4184  $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
4185  }
4186  }
4187  } else {
4188  if (isset($attrs['type'])) {
4189  // serialize schema-defined type
4190  $xml .= $this->serializeType($eName, $attrs['type'], $v, $use, $encodingStyle);
4191  } else {
4192  // serialize generic type
4193  $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
4194  $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
4195  }
4196  }
4197  }
4198  }
4199  } else {
4200  $this->debug("Expected elements for XML Schema type $ns:$uqType");
4201  }
4202  $xml .= "</$elementName>";
4203  } elseif ($phpType == 'array') {
4204  if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
4205  $elementNS = " xmlns=\"$ns\"";
4206  } else {
4207  $elementNS = '';
4208  }
4209  if (is_null($value)) {
4210  if ($use == 'literal') {
4211  // TODO: depends on nillable
4212  return "<$name$elementNS/>";
4213  } else {
4214  return "<$name$elementNS xsi:nil=\"true\"/>";
4215  }
4216  }
4217  if (isset($typeDef['multidimensional'])) {
4218  $nv = array();
4219  foreach($value as $v) {
4220  $cols = ',' . sizeof($v);
4221  $nv = array_merge($nv, $v);
4222  }
4223  $value = $nv;
4224  } else {
4225  $cols = '';
4226  }
4227  if (is_array($value) && sizeof($value) >= 1) {
4228  $rows = sizeof($value);
4229  $contents = '';
4230  foreach($value as $k => $v) {
4231  $this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]");
4232  //if (strpos($typeDef['arrayType'], ':') ) {
4233  if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) {
4234  $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);
4235  } else {
4236  $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use);
4237  }
4238  }
4239  $this->debug('contents: '.$this->varDump($contents));
4240  } else {
4241  $rows = 0;
4242  $contents = null;
4243  }
4244  // TODO: for now, an empty value will be serialized as a zero element
4245  // array. Revisit this when coding the handling of null/nil values.
4246  if ($use == 'literal') {
4247  $xml = "<$name$elementNS>"
4248  .$contents
4249  ."</$name>";
4250  } else {
4251  $xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/').':Array" '.
4252  $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/')
4253  .':arrayType="'
4254  .$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType']))
4255  .":".$this->getLocalPart($typeDef['arrayType'])."[$rows$cols]\">"
4256  .$contents
4257  ."</$name>";
4258  }
4259  } elseif ($phpType == 'scalar') {
4260  if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
4261  $elementNS = " xmlns=\"$ns\"";
4262  } else {
4263  $elementNS = '';
4264  }
4265  if ($use == 'literal') {
4266  if ($forceType) {
4267  return "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
4268  } else {
4269  return "<$name$elementNS>$value</$name>";
4270  }
4271  } else {
4272  return "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
4273  }
4274  }
4275  $this->debug('returning: '.$this->varDump($xml));
4276  return $xml;
4277  }
setError($str)
sets error string
Definition: nusoap.php:184
serializeType($name, $type, $value, $use='encoded', $encodingStyle=false)
serializes a PHP value according a given type definition
Definition: nusoap.php:4020
getTypeDef($type, $ns)
returns an array of information about a given type returns false if no type exists by the given name ...
Definition: nusoap.php:3718
isArraySimpleOrStruct($val)
detect if array is a simple array or a struct (associative array)
Definition: nusoap.php:195
$type
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$xml
Definition: metadata.php:240
if($format !==null) $name
Definition: metadata.php:146
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:557
serialize_val($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded')
serializes PHP values in accordance w/ section 5.
Definition: nusoap.php:212
Create styles array
The data for the language used.
varDump($data)
Definition: nusoap.php:567
getPrefix($str)
returns the prefix part of a prefixed string returns false, if not prefixed
Definition: nusoap.php:525
$rows
Definition: xhr_table.php:10
expandEntities($val)
expands entities, e.g.
Definition: nusoap.php:154
getNamespaceFromPrefix($prefix)
pass it a prefix, it returns a namespace returns false if no namespace registered with the given pref...
Definition: nusoap.php:541
$cols
Definition: xhr_table.php:11
+ Here is the call graph for this function:

◆ serializeType() [2/2]

wsdl::serializeType (   $name,
  $type,
  $value,
  $use = 'encoded',
  $encodingStyle = false,
  $unqualified = false 
)

serializes a PHP value according a given type definition

Parameters
string$namename of value (part or element)
string$typeXML schema type of value (type or element)
mixed$valuea native PHP value (parameter value)
string$useuse for part (encoded|literal)
string$encodingStyleSOAP encoding style for the value (if different than the enclosing style)
boolean$unqualifieda kludge for what should be XML namespace form handling
Returns
string value serialized as an XML string private

Definition at line 5781 of file nusoap.php.

References $cols, $contents, $n, $name, $rows, $type, $xml, nusoap_base\appendDebug(), array, nusoap_base\debug(), nusoap_base\expandEntities(), nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), nusoap_base\getPrefix(), nusoap_base\getPrefixFromNamespace(), nusoap_base\serialize_val(), nusoap_base\setError(), and nusoap_base\varDump().

5782  {
5783  $this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified"));
5784  $this->appendDebug("value=" . $this->varDump($value));
5785  if($use == 'encoded' && $encodingStyle) {
5786  $encodingStyle = ' SOAP-ENV:encodingStyle="' . $encodingStyle . '"';
5787  }
5788 
5789  // if a soapval has been supplied, let its type override the WSDL
5790  if (is_object($value) && get_class($value) == 'soapval') {
5791  if ($value->type_ns) {
5792  $type = $value->type_ns . ':' . $value->type;
5793  $forceType = true;
5794  $this->debug("in serializeType: soapval overrides type to $type");
5795  } elseif ($value->type) {
5796  $type = $value->type;
5797  $forceType = true;
5798  $this->debug("in serializeType: soapval overrides type to $type");
5799  } else {
5800  $forceType = false;
5801  $this->debug("in serializeType: soapval does not override type");
5802  }
5803  $attrs = $value->attributes;
5804  $value = $value->value;
5805  $this->debug("in serializeType: soapval overrides value to $value");
5806  if ($attrs) {
5807  if (!is_array($value)) {
5808  $value['!'] = $value;
5809  }
5810  foreach ($attrs as $n => $v) {
5811  $value['!' . $n] = $v;
5812  }
5813  $this->debug("in serializeType: soapval provides attributes");
5814  }
5815  } else {
5816  $forceType = false;
5817  }
5818 
5819  $xml = '';
5820  if (strpos($type, ':')) {
5821  $uqType = substr($type, strrpos($type, ':') + 1);
5822  $ns = substr($type, 0, strrpos($type, ':'));
5823  $this->debug("in serializeType: got a prefixed type: $uqType, $ns");
5824  if ($this->getNamespaceFromPrefix($ns)) {
5825  $ns = $this->getNamespaceFromPrefix($ns);
5826  $this->debug("in serializeType: expanded prefixed type: $uqType, $ns");
5827  }
5828 
5829  if($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/'){
5830  $this->debug('in serializeType: type namespace indicates XML Schema or SOAP Encoding type');
5831  if ($unqualified && $use == 'literal') {
5832  $elementNS = " xmlns=\"\"";
5833  } else {
5834  $elementNS = '';
5835  }
5836  if (is_null($value)) {
5837  if ($use == 'literal') {
5838  // TODO: depends on minOccurs
5839  $xml = "<$name$elementNS/>";
5840  } else {
5841  // TODO: depends on nillable, which should be checked before calling this method
5842  $xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
5843  }
5844  $this->debug("in serializeType: returning: $xml");
5845  return $xml;
5846  }
5847  if ($uqType == 'Array') {
5848  // JBoss/Axis does this sometimes
5849  return $this->serialize_val($value, $name, false, false, false, false, $use);
5850  }
5851  if ($uqType == 'boolean') {
5852  if ((is_string($value) && $value == 'false') || (! $value)) {
5853  $value = 'false';
5854  } else {
5855  $value = 'true';
5856  }
5857  }
5858  if ($uqType == 'string' && gettype($value) == 'string') {
5859  $value = $this->expandEntities($value);
5860  }
5861  if (($uqType == 'long' || $uqType == 'unsignedLong') && gettype($value) == 'double') {
5862  $value = sprintf("%.0lf", $value);
5863  }
5864  // it's a scalar
5865  // TODO: what about null/nil values?
5866  // check type isn't a custom type extending xmlschema namespace
5867  if (!$this->getTypeDef($uqType, $ns)) {
5868  if ($use == 'literal') {
5869  if ($forceType) {
5870  $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
5871  } else {
5872  $xml = "<$name$elementNS>$value</$name>";
5873  }
5874  } else {
5875  $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
5876  }
5877  $this->debug("in serializeType: returning: $xml");
5878  return $xml;
5879  }
5880  $this->debug('custom type extends XML Schema or SOAP Encoding namespace (yuck)');
5881  } else if ($ns == 'http://xml.apache.org/xml-soap') {
5882  $this->debug('in serializeType: appears to be Apache SOAP type');
5883  if ($uqType == 'Map') {
5884  $tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
5885  if (! $tt_prefix) {
5886  $this->debug('in serializeType: Add namespace for Apache SOAP type');
5887  $tt_prefix = 'ns' . rand(1000, 9999);
5888  $this->namespaces[$tt_prefix] = 'http://xml.apache.org/xml-soap';
5889  // force this to be added to usedNamespaces
5890  $tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
5891  }
5892  $contents = '';
5893  foreach($value as $k => $v) {
5894  $this->debug("serializing map element: key $k, value $v");
5895  $contents .= '<item>';
5896  $contents .= $this->serialize_val($k,'key',false,false,false,false,$use);
5897  $contents .= $this->serialize_val($v,'value',false,false,false,false,$use);
5898  $contents .= '</item>';
5899  }
5900  if ($use == 'literal') {
5901  if ($forceType) {
5902  $xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\">$contents</$name>";
5903  } else {
5904  $xml = "<$name>$contents</$name>";
5905  }
5906  } else {
5907  $xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\"$encodingStyle>$contents</$name>";
5908  }
5909  $this->debug("in serializeType: returning: $xml");
5910  return $xml;
5911  }
5912  $this->debug('in serializeType: Apache SOAP type, but only support Map');
5913  }
5914  } else {
5915  // TODO: should the type be compared to types in XSD, and the namespace
5916  // set to XSD if the type matches?
5917  $this->debug("in serializeType: No namespace for type $type");
5918  $ns = '';
5919  $uqType = $type;
5920  }
5921  if(!$typeDef = $this->getTypeDef($uqType, $ns)){
5922  $this->setError("$type ($uqType) is not a supported type.");
5923  $this->debug("in serializeType: $type ($uqType) is not a supported type.");
5924  return false;
5925  } else {
5926  $this->debug("in serializeType: found typeDef");
5927  $this->appendDebug('typeDef=' . $this->varDump($typeDef));
5928  if (substr($uqType, -1) == '^') {
5929  $uqType = substr($uqType, 0, -1);
5930  }
5931  }
5932  $phpType = $typeDef['phpType'];
5933  $this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') );
5934  // if php type == struct, map value to the <all> element names
5935  if ($phpType == 'struct') {
5936  if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') {
5937  $elementName = $uqType;
5938  if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
5939  $elementNS = " xmlns=\"$ns\"";
5940  } else {
5941  $elementNS = " xmlns=\"\"";
5942  }
5943  } else {
5944  $elementName = $name;
5945  if ($unqualified) {
5946  $elementNS = " xmlns=\"\"";
5947  } else {
5948  $elementNS = '';
5949  }
5950  }
5951  if (is_null($value)) {
5952  if ($use == 'literal') {
5953  // TODO: depends on minOccurs
5954  $xml = "<$elementName$elementNS/>";
5955  } else {
5956  $xml = "<$elementName$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
5957  }
5958  $this->debug("in serializeType: returning: $xml");
5959  return $xml;
5960  }
5961  if (is_object($value)) {
5962  $value = get_object_vars($value);
5963  }
5964  if (is_array($value)) {
5965  $elementAttrs = $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
5966  if ($use == 'literal') {
5967  if ($forceType) {
5968  $xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">";
5969  } else {
5970  $xml = "<$elementName$elementNS$elementAttrs>";
5971  }
5972  } else {
5973  $xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>";
5974  }
5975 
5976  $xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle);
5977  $xml .= "</$elementName>";
5978  } else {
5979  $this->debug("in serializeType: phpType is struct, but value is not an array");
5980  $this->setError("phpType is struct, but value is not an array: see debug output for details");
5981  $xml = '';
5982  }
5983  } elseif ($phpType == 'array') {
5984  if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
5985  $elementNS = " xmlns=\"$ns\"";
5986  } else {
5987  if ($unqualified) {
5988  $elementNS = " xmlns=\"\"";
5989  } else {
5990  $elementNS = '';
5991  }
5992  }
5993  if (is_null($value)) {
5994  if ($use == 'literal') {
5995  // TODO: depends on minOccurs
5996  $xml = "<$name$elementNS/>";
5997  } else {
5998  $xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" .
5999  $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
6000  ":Array\" " .
6001  $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
6002  ':arrayType="' .
6003  $this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) .
6004  ':' .
6005  $this->getLocalPart($typeDef['arrayType'])."[0]\"/>";
6006  }
6007  $this->debug("in serializeType: returning: $xml");
6008  return $xml;
6009  }
6010  if (isset($typeDef['multidimensional'])) {
6011  $nv = array();
6012  foreach($value as $v) {
6013  $cols = ',' . sizeof($v);
6014  $nv = array_merge($nv, $v);
6015  }
6016  $value = $nv;
6017  } else {
6018  $cols = '';
6019  }
6020  if (is_array($value) && sizeof($value) >= 1) {
6021  $rows = sizeof($value);
6022  $contents = '';
6023  foreach($value as $k => $v) {
6024  $this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]");
6025  //if (strpos($typeDef['arrayType'], ':') ) {
6026  if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) {
6027  $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);
6028  } else {
6029  $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use);
6030  }
6031  }
6032  } else {
6033  $rows = 0;
6034  $contents = null;
6035  }
6036  // TODO: for now, an empty value will be serialized as a zero element
6037  // array. Revisit this when coding the handling of null/nil values.
6038  if ($use == 'literal') {
6039  $xml = "<$name$elementNS>"
6040  .$contents
6041  ."</$name>";
6042  } else {
6043  $xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/').':Array" '.
6044  $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/')
6045  .':arrayType="'
6046  .$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType']))
6047  .":".$this->getLocalPart($typeDef['arrayType'])."[$rows$cols]\">"
6048  .$contents
6049  ."</$name>";
6050  }
6051  } elseif ($phpType == 'scalar') {
6052  if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
6053  $elementNS = " xmlns=\"$ns\"";
6054  } else {
6055  if ($unqualified) {
6056  $elementNS = " xmlns=\"\"";
6057  } else {
6058  $elementNS = '';
6059  }
6060  }
6061  if ($use == 'literal') {
6062  if ($forceType) {
6063  $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
6064  } else {
6065  $xml = "<$name$elementNS>$value</$name>";
6066  }
6067  } else {
6068  $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
6069  }
6070  }
6071  $this->debug("in serializeType: returning: $xml");
6072  return $xml;
6073  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:294
setError($str)
sets error string
Definition: nusoap.php:184
serializeType($name, $type, $value, $use='encoded', $encodingStyle=false)
serializes a PHP value according a given type definition
Definition: nusoap.php:4020
getTypeDef($type, $ns)
returns an array of information about a given type returns false if no type exists by the given name ...
Definition: nusoap.php:3718
$type
serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false)
serializes the elements for a complexType
Definition: nusoap.php:6147
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$xml
Definition: metadata.php:240
if($format !==null) $name
Definition: metadata.php:146
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:557
serialize_val($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded')
serializes PHP values in accordance w/ section 5.
Definition: nusoap.php:212
$n
Definition: RandomTest.php:85
Create styles array
The data for the language used.
varDump($data)
Definition: nusoap.php:567
getPrefix($str)
returns the prefix part of a prefixed string returns false, if not prefixed
Definition: nusoap.php:525
$rows
Definition: xhr_table.php:10
expandEntities($val)
expands entities, e.g.
Definition: nusoap.php:154
serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType)
serializes the attributes for a complexType
Definition: nusoap.php:6085
getNamespaceFromPrefix($prefix)
pass it a prefix, it returns a namespace returns false if no namespace registered with the given pref...
Definition: nusoap.php:541
$cols
Definition: xhr_table.php:11
+ Here is the call graph for this function:

◆ setCredentials()

wsdl::setCredentials (   $username,
  $password,
  $authtype = 'basic',
  $certRequest = array() 
)

if authenticating, set user credentials here

Parameters
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) public

Definition at line 5058 of file nusoap.php.

References $password, nusoap_base\appendDebug(), nusoap_base\debug(), and nusoap_base\varDump().

Referenced by nusoap_client\loadWSDL().

5058  {
5059  $this->debug("setCredentials username=$username authtype=$authtype certRequest=");
5060  $this->appendDebug($this->varDump($certRequest));
5061  $this->username = $username;
5062  $this->password = $password;
5063  $this->authtype = $authtype;
5064  $this->certRequest = $certRequest;
5065  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:294
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$password
Definition: nusoap.php:4550
$authtype
Definition: nusoap.php:4551
$username
Definition: nusoap.php:4549
varDump($data)
Definition: nusoap.php:567
$certRequest
Definition: nusoap.php:4552
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start_element() [1/2]

wsdl::start_element (   $parser,
  $name,
  $attrs 
)

start-element handler

Parameters
string$parserXML parser object
string$nameelement name
string$attrsassociative array of attributes private

Definition at line 3389 of file nusoap.php.

References $m, $name, $namespace, array, nusoap_base\debug(), nusoap_base\expandQname(), nusoap_base\getLocalPart(), and nusoap_base\getPrefixFromNamespace().

3390  {
3391  if ($this->status == 'schema') {
3392  $this->currentSchema->schemaStartElement($parser, $name, $attrs);
3393  $this->debug_str .= $this->currentSchema->debug_str;
3394  $this->currentSchema->debug_str = '';
3395  } elseif (ereg('schema$', $name)) {
3396  // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
3397  $this->status = 'schema';
3398  $this->currentSchema = new xmlschema('', '', $this->namespaces);
3399  $this->currentSchema->schemaStartElement($parser, $name, $attrs);
3400  $this->debug_str .= $this->currentSchema->debug_str;
3401  $this->currentSchema->debug_str = '';
3402  } else {
3403  // position in the total number of elements, starting from 0
3404  $pos = $this->position++;
3405  $depth = $this->depth++;
3406  // set self as current value for this depth
3407  $this->depth_array[$depth] = $pos;
3408  $this->message[$pos] = array('cdata' => '');
3409  // get element prefix
3410  if (ereg(':', $name)) {
3411  // get ns prefix
3412  $prefix = substr($name, 0, strpos($name, ':'));
3413  // get ns
3414  $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : '';
3415  // get unqualified name
3416  $name = substr(strstr($name, ':'), 1);
3417  }
3418 
3419  if (count($attrs) > 0) {
3420  foreach($attrs as $k => $v) {
3421  // if ns declarations, add to class level array of valid namespaces
3422  if (ereg("^xmlns", $k)) {
3423  if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
3424  $this->namespaces[$ns_prefix] = $v;
3425  } else {
3426  $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v;
3427  }
3428  if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema') {
3429  $this->XMLSchemaVersion = $v;
3430  $this->namespaces['xsi'] = $v . '-instance';
3431  }
3432  } //
3433  // expand each attribute
3434  $k = strpos($k, ':') ? $this->expandQname($k) : $k;
3435  if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') {
3436  $v = strpos($v, ':') ? $this->expandQname($v) : $v;
3437  }
3438  $eAttrs[$k] = $v;
3439  }
3440  $attrs = $eAttrs;
3441  } else {
3442  $attrs = array();
3443  }
3444  // find status, register data
3445  switch ($this->status) {
3446  case 'message':
3447  if ($name == 'part') {
3448  if (isset($attrs['type'])) {
3449  $this->debug("msg " . $this->currentMessage . ": found part $attrs[name]: " . implode(',', $attrs));
3450  $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type'];
3451  }
3452  if (isset($attrs['element'])) {
3453  $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'];
3454  }
3455  }
3456  break;
3457  case 'portType':
3458  switch ($name) {
3459  case 'operation':
3460  $this->currentPortOperation = $attrs['name'];
3461  $this->debug("portType $this->currentPortType operation: $this->currentPortOperation");
3462  if (isset($attrs['parameterOrder'])) {
3463  $this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder'];
3464  }
3465  break;
3466  case 'documentation':
3467  $this->documentation = true;
3468  break;
3469  // merge input/output data
3470  default:
3471  $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : '';
3472  $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m;
3473  break;
3474  }
3475  break;
3476  case 'binding':
3477  switch ($name) {
3478  case 'binding':
3479  // get ns prefix
3480  if (isset($attrs['style'])) {
3481  $this->bindings[$this->currentBinding]['prefix'] = $prefix;
3482  }
3483  $this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs);
3484  break;
3485  case 'header':
3486  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus]['headers'][] = $attrs;
3487  break;
3488  case 'operation':
3489  if (isset($attrs['soapAction'])) {
3490  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction'];
3491  }
3492  if (isset($attrs['style'])) {
3493  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style'];
3494  }
3495  if (isset($attrs['name'])) {
3496  $this->currentOperation = $attrs['name'];
3497  $this->debug("current binding operation: $this->currentOperation");
3498  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name'];
3499  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding;
3500  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : '';
3501  }
3502  break;
3503  case 'input':
3504  $this->opStatus = 'input';
3505  break;
3506  case 'output':
3507  $this->opStatus = 'output';
3508  break;
3509  case 'body':
3510  if (isset($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus])) {
3511  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs);
3512  } else {
3513  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs;
3514  }
3515  break;
3516  }
3517  break;
3518  case 'service':
3519  switch ($name) {
3520  case 'port':
3521  $this->currentPort = $attrs['name'];
3522  $this->debug('current port: ' . $this->currentPort);
3523  $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']);
3524 
3525  break;
3526  case 'address':
3527  $this->ports[$this->currentPort]['location'] = $attrs['location'];
3528  $this->ports[$this->currentPort]['bindingType'] = $namespace;
3529  $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace;
3530  $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location'];
3531  break;
3532  }
3533  break;
3534  }
3535  // set status
3536  switch ($name) {
3537  case 'import':
3538  if (isset($attrs['location'])) {
3539  $this->import[$attrs['namespace']][] = array('location' => $attrs['location'], 'loaded' => false);
3540  $this->debug('parsing import ' . $attrs['namespace']. ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]).')');
3541  } else {
3542  $this->import[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
3543  if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
3544  $this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace'];
3545  }
3546  $this->debug('parsing import ' . $attrs['namespace']. ' - [no location] (' . count($this->import[$attrs['namespace']]).')');
3547  }
3548  break;
3549  //wait for schema
3550  //case 'types':
3551  // $this->status = 'schema';
3552  // break;
3553  case 'message':
3554  $this->status = 'message';
3555  $this->messages[$attrs['name']] = array();
3556  $this->currentMessage = $attrs['name'];
3557  break;
3558  case 'portType':
3559  $this->status = 'portType';
3560  $this->portTypes[$attrs['name']] = array();
3561  $this->currentPortType = $attrs['name'];
3562  break;
3563  case "binding":
3564  if (isset($attrs['name'])) {
3565  // get binding name
3566  if (strpos($attrs['name'], ':')) {
3567  $this->currentBinding = $this->getLocalPart($attrs['name']);
3568  } else {
3569  $this->currentBinding = $attrs['name'];
3570  }
3571  $this->status = 'binding';
3572  $this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']);
3573  $this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']);
3574  }
3575  break;
3576  case 'service':
3577  $this->serviceName = $attrs['name'];
3578  $this->status = 'service';
3579  $this->debug('current service: ' . $this->serviceName);
3580  break;
3581  case 'definitions':
3582  foreach ($attrs as $name => $value) {
3583  $this->wsdl_info[$name] = $value;
3584  }
3585  break;
3586  }
3587  }
3588  }
if($err=$client->getError()) $namespace
$currentBinding
Definition: nusoap.php:3147
$depth
Definition: nusoap.php:3159
$currentPortType
Definition: nusoap.php:3145
$parser
Definition: nusoap.php:3157
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$currentPort
Definition: nusoap.php:3149
if($format !==null) $name
Definition: metadata.php:146
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:557
expandQname($qname)
expands a qualified name
Definition: nusoap.php:483
Create styles array
The data for the language used.
$currentOperation
Definition: nusoap.php:3143
$currentMessage
Definition: nusoap.php:3142
+ Here is the call graph for this function:

◆ start_element() [2/2]

wsdl::start_element (   $parser,
  $name,
  $attrs 
)

start-element handler

Parameters
string$parserXML parser object
string$nameelement name
string$attrsassociative array of attributes private

Definition at line 4795 of file nusoap.php.

References $m, $name, $namespace, nusoap_base\appendDebug(), array, nusoap_base\debug(), nusoap_base\expandQname(), nusoap_base\getLocalPart(), and nusoap_base\getPrefixFromNamespace().

4796  {
4797  if ($this->status == 'schema') {
4798  $this->currentSchema->schemaStartElement($parser, $name, $attrs);
4799  $this->appendDebug($this->currentSchema->getDebug());
4800  $this->currentSchema->clearDebug();
4801  } elseif (preg_match('/schema$/', $name)) {
4802  $this->debug('Parsing WSDL schema');
4803  // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
4804  $this->status = 'schema';
4805  $this->currentSchema = new nusoap_xmlschema('', '', $this->namespaces);
4806  $this->currentSchema->schemaStartElement($parser, $name, $attrs);
4807  $this->appendDebug($this->currentSchema->getDebug());
4808  $this->currentSchema->clearDebug();
4809  } else {
4810  // position in the total number of elements, starting from 0
4811  $pos = $this->position++;
4812  $depth = $this->depth++;
4813  // set self as current value for this depth
4814  $this->depth_array[$depth] = $pos;
4815  $this->message[$pos] = array('cdata' => '');
4816  // process attributes
4817  if (count($attrs) > 0) {
4818  // register namespace declarations
4819  foreach($attrs as $k => $v) {
4820  if (preg_match('/^xmlns/',$k)) {
4821  if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
4822  $this->namespaces[$ns_prefix] = $v;
4823  } else {
4824  $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v;
4825  }
4826  if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') {
4827  $this->XMLSchemaVersion = $v;
4828  $this->namespaces['xsi'] = $v . '-instance';
4829  }
4830  }
4831  }
4832  // expand each attribute prefix to its namespace
4833  foreach($attrs as $k => $v) {
4834  $k = strpos($k, ':') ? $this->expandQname($k) : $k;
4835  if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') {
4836  $v = strpos($v, ':') ? $this->expandQname($v) : $v;
4837  }
4838  $eAttrs[$k] = $v;
4839  }
4840  $attrs = $eAttrs;
4841  } else {
4842  $attrs = array();
4843  }
4844  // get element prefix, namespace and name
4845  if (preg_match('/:/', $name)) {
4846  // get ns prefix
4847  $prefix = substr($name, 0, strpos($name, ':'));
4848  // get ns
4849  $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : '';
4850  // get unqualified name
4851  $name = substr(strstr($name, ':'), 1);
4852  }
4853  // process attributes, expanding any prefixes to namespaces
4854  // find status, register data
4855  switch ($this->status) {
4856  case 'message':
4857  if ($name == 'part') {
4858  if (isset($attrs['type'])) {
4859  $this->debug("msg " . $this->currentMessage . ": found part (with type) $attrs[name]: " . implode(',', $attrs));
4860  $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type'];
4861  }
4862  if (isset($attrs['element'])) {
4863  $this->debug("msg " . $this->currentMessage . ": found part (with element) $attrs[name]: " . implode(',', $attrs));
4864  $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'] . '^';
4865  }
4866  }
4867  break;
4868  case 'portType':
4869  switch ($name) {
4870  case 'operation':
4871  $this->currentPortOperation = $attrs['name'];
4872  $this->debug("portType $this->currentPortType operation: $this->currentPortOperation");
4873  if (isset($attrs['parameterOrder'])) {
4874  $this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder'];
4875  }
4876  break;
4877  case 'documentation':
4878  $this->documentation = true;
4879  break;
4880  // merge input/output data
4881  default:
4882  $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : '';
4883  $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m;
4884  break;
4885  }
4886  break;
4887  case 'binding':
4888  switch ($name) {
4889  case 'binding':
4890  // get ns prefix
4891  if (isset($attrs['style'])) {
4892  $this->bindings[$this->currentBinding]['prefix'] = $prefix;
4893  }
4894  $this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs);
4895  break;
4896  case 'header':
4897  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus]['headers'][] = $attrs;
4898  break;
4899  case 'operation':
4900  if (isset($attrs['soapAction'])) {
4901  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction'];
4902  }
4903  if (isset($attrs['style'])) {
4904  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style'];
4905  }
4906  if (isset($attrs['name'])) {
4907  $this->currentOperation = $attrs['name'];
4908  $this->debug("current binding operation: $this->currentOperation");
4909  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name'];
4910  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding;
4911  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : '';
4912  }
4913  break;
4914  case 'input':
4915  $this->opStatus = 'input';
4916  break;
4917  case 'output':
4918  $this->opStatus = 'output';
4919  break;
4920  case 'body':
4921  if (isset($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus])) {
4922  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs);
4923  } else {
4924  $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs;
4925  }
4926  break;
4927  }
4928  break;
4929  case 'service':
4930  switch ($name) {
4931  case 'port':
4932  $this->currentPort = $attrs['name'];
4933  $this->debug('current port: ' . $this->currentPort);
4934  $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']);
4935 
4936  break;
4937  case 'address':
4938  $this->ports[$this->currentPort]['location'] = $attrs['location'];
4939  $this->ports[$this->currentPort]['bindingType'] = $namespace;
4940  $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace;
4941  $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location'];
4942  break;
4943  }
4944  break;
4945  }
4946  // set status
4947  switch ($name) {
4948  case 'import':
4949  if (isset($attrs['location'])) {
4950  $this->import[$attrs['namespace']][] = array('location' => $attrs['location'], 'loaded' => false);
4951  $this->debug('parsing import ' . $attrs['namespace']. ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]).')');
4952  } else {
4953  $this->import[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
4954  if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
4955  $this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace'];
4956  }
4957  $this->debug('parsing import ' . $attrs['namespace']. ' - [no location] (' . count($this->import[$attrs['namespace']]).')');
4958  }
4959  break;
4960  //wait for schema
4961  //case 'types':
4962  // $this->status = 'schema';
4963  // break;
4964  case 'message':
4965  $this->status = 'message';
4966  $this->messages[$attrs['name']] = array();
4967  $this->currentMessage = $attrs['name'];
4968  break;
4969  case 'portType':
4970  $this->status = 'portType';
4971  $this->portTypes[$attrs['name']] = array();
4972  $this->currentPortType = $attrs['name'];
4973  break;
4974  case "binding":
4975  if (isset($attrs['name'])) {
4976  // get binding name
4977  if (strpos($attrs['name'], ':')) {
4978  $this->currentBinding = $this->getLocalPart($attrs['name']);
4979  } else {
4980  $this->currentBinding = $attrs['name'];
4981  }
4982  $this->status = 'binding';
4983  $this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']);
4984  $this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']);
4985  }
4986  break;
4987  case 'service':
4988  $this->serviceName = $attrs['name'];
4989  $this->status = 'service';
4990  $this->debug('current service: ' . $this->serviceName);
4991  break;
4992  case 'definitions':
4993  foreach ($attrs as $name => $value) {
4994  $this->wsdl_info[$name] = $value;
4995  }
4996  break;
4997  }
4998  }
4999  }
if($err=$client->getError()) $namespace
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:294
$currentBinding
Definition: nusoap.php:3147
$depth
Definition: nusoap.php:3159
$currentPortType
Definition: nusoap.php:3145
$parser
Definition: nusoap.php:3157
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$currentPort
Definition: nusoap.php:3149
if($format !==null) $name
Definition: metadata.php:146
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:557
expandQname($qname)
expands a qualified name
Definition: nusoap.php:483
parses an XML Schema, allows access to it&#39;s data, other utility methods.
Definition: nusoap.php:1092
Create styles array
The data for the language used.
$currentOperation
Definition: nusoap.php:3143
$currentMessage
Definition: nusoap.php:3142
+ Here is the call graph for this function:

◆ webDescription()

wsdl::webDescription ( )

prints html description of services

private

Definition at line 5238 of file nusoap.php.

References $_SERVER, $data, and nusoap_base\setError().

Referenced by nusoap_server\service().

5238  {
5239  global $HTTP_SERVER_VARS;
5240 
5241  if (isset($_SERVER)) {
5242  $PHP_SELF = $_SERVER['PHP_SELF'];
5243  } elseif (isset($HTTP_SERVER_VARS)) {
5244  $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
5245  } else {
5246  $this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available");
5247  }
5248 
5249  $b = '
5250  <html><head><title>NuSOAP: '.$this->serviceName.'</title>
5251  <style type="text/css">
5252  body { font-family: arial; color: #000000; background-color: #ffffff; margin: 0px 0px 0px 0px; }
5253  p { font-family: arial; color: #000000; margin-top: 0px; margin-bottom: 12px; }
5254  pre { background-color: silver; padding: 5px; font-family: Courier New; font-size: x-small; color: #000000;}
5255  ul { margin-top: 10px; margin-left: 20px; }
5256  li { list-style-type: none; margin-top: 10px; color: #000000; }
5257  .content{
5258  margin-left: 0px; padding-bottom: 2em; }
5259  .nav {
5260  padding-top: 10px; padding-bottom: 10px; padding-left: 15px; font-size: .70em;
5261  margin-top: 10px; margin-left: 0px; color: #000000;
5262  background-color: #ccccff; width: 20%; margin-left: 20px; margin-top: 20px; }
5263  .title {
5264  font-family: arial; font-size: 26px; color: #ffffff;
5265  background-color: #999999; width: 105%; margin-left: 0px;
5266  padding-top: 10px; padding-bottom: 10px; padding-left: 15px;}
5267  .hidden {
5268  position: absolute; visibility: hidden; z-index: 200; left: 250px; top: 100px;
5269  font-family: arial; overflow: hidden; width: 600;
5270  padding: 20px; font-size: 10px; background-color: #999999;
5271  layer-background-color:#FFFFFF; }
5272  a,a:active { color: charcoal; font-weight: bold; }
5273  a:visited { color: #666666; font-weight: bold; }
5274  a:hover { color: cc3300; font-weight: bold; }
5275  </style>
5276  <script language="JavaScript" type="text/javascript">
5277  <!--
5278  // POP-UP CAPTIONS...
5279  function lib_bwcheck(){ //Browsercheck (needed)
5280  this.ver=navigator.appVersion
5281  this.agent=navigator.userAgent
5282  this.dom=document.getElementById?1:0
5283  this.opera5=this.agent.indexOf("Opera 5")>-1
5284  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
5285  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
5286  this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
5287  this.ie=this.ie4||this.ie5||this.ie6
5288  this.mac=this.agent.indexOf("Mac")>-1
5289  this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
5290  this.ns4=(document.layers && !this.dom)?1:0;
5291  this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
5292  return this
5293  }
5294  var bw = new lib_bwcheck()
5295  //Makes crossbrowser object.
5296  function makeObj(obj){
5297  this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
5298  if(!this.evnt) return false
5299  this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;
5300  this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;
5301  this.writeIt=b_writeIt;
5302  return this
5303  }
5304  // A unit of measure that will be added when setting the position of a layer.
5305  //var px = bw.ns4||window.opera?"":"px";
5306  function b_writeIt(text){
5307  if (bw.ns4){this.wref.write(text);this.wref.close()}
5308  else this.wref.innerHTML = text
5309  }
5310  //Shows the messages
5311  var oDesc;
5312  function popup(divid){
5313  if(oDesc = new makeObj(divid)){
5314  oDesc.css.visibility = "visible"
5315  }
5316  }
5317  function popout(){ // Hides message
5318  if(oDesc) oDesc.css.visibility = "hidden"
5319  }
5320  //-->
5321  </script>
5322  </head>
5323  <body>
5324  <div class=content>
5325  <br><br>
5326  <div class=title>'.$this->serviceName.'</div>
5327  <div class=nav>
5328  <p>View the <a href="'.$PHP_SELF.'?wsdl">WSDL</a> for the service.
5329  Click on an operation name to view it&apos;s details.</p>
5330  <ul>';
5331  foreach($this->getOperations() as $op => $data){
5332  $b .= "<li><a href='#' onclick=\"popout();popup('$op')\">$op</a></li>";
5333  // create hidden div
5334  $b .= "<div id='$op' class='hidden'>
5335  <a href='#' onclick='popout()'><font color='#ffffff'>Close</font></a><br><br>";
5336  foreach($data as $donnie => $marie){ // loop through opdata
5337  if($donnie == 'input' || $donnie == 'output'){ // show input/output data
5338  $b .= "<font color='white'>".ucfirst($donnie).':</font><br>';
5339  foreach($marie as $captain => $tenille){ // loop through data
5340  if($captain == 'parts'){ // loop thru parts
5341  $b .= "&nbsp;&nbsp;$captain:<br>";
5342  //if(is_array($tenille)){
5343  foreach($tenille as $joanie => $chachi){
5344  $b .= "&nbsp;&nbsp;&nbsp;&nbsp;$joanie: $chachi<br>";
5345  }
5346  //}
5347  } else {
5348  $b .= "&nbsp;&nbsp;$captain: $tenille<br>";
5349  }
5350  }
5351  } else {
5352  $b .= "<font color='white'>".ucfirst($donnie).":</font> $marie<br>";
5353  }
5354  }
5355  $b .= '</div>';
5356  }
5357  $b .= '
5358  <ul>
5359  </div>
5360  </div></body></html>';
5361  return $b;
5362  }
setError($str)
sets error string
Definition: nusoap.php:184
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
getOperations($bindingType='soap')
returns an assoc array of operation names => operation data
Definition: nusoap.php:3649
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wsdl()

wsdl::wsdl (   $wsdl = '',
  $proxyhost = false,
  $proxyport = false,
  $proxyusername = false,
  $proxypassword = false,
  $timeout = 0,
  $response_timeout = 30 
)

constructor

Parameters
string$wsdlWSDL document URL
string$proxyhost
string$proxyport
string$proxyusername
string$proxypassword
integer$timeoutset the connection timeout
integer$response_timeoutset the response timeout public

Definition at line 3181 of file nusoap.php.

References $binding, $data, $list, $url, array, and nusoap_base\debug().

Referenced by nusoap_server\__construct(), nusoap_client\__construct(), soap_client\soap_client(), and soap_server\soap_server().

3181  {
3182  $this->wsdl = $wsdl;
3183  $this->proxyhost = $proxyhost;
3184  $this->proxyport = $proxyport;
3185  $this->proxyusername = $proxyusername;
3186  $this->proxypassword = $proxypassword;
3187  $this->timeout = $timeout;
3188  $this->response_timeout = $response_timeout;
3189 
3190  // parse wsdl file
3191  if ($wsdl != "") {
3192  $this->debug('initial wsdl URL: ' . $wsdl);
3193  $this->parseWSDL($wsdl);
3194  }
3195  // imports
3196  // TODO: handle imports more properly, grabbing them in-line and nesting them
3197  $imported_urls = array();
3198  $imported = 1;
3199  while ($imported > 0) {
3200  $imported = 0;
3201  // Schema imports
3202  foreach ($this->schemas as $ns => $list) {
3203  foreach ($list as $xs) {
3204  $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
3205  foreach ($xs->imports as $ns2 => $list2) {
3206  for ($ii = 0; $ii < count($list2); $ii++) {
3207  if (! $list2[$ii]['loaded']) {
3208  $this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true;
3209  $url = $list2[$ii]['location'];
3210  if ($url != '') {
3211  $urlparts = parse_url($url);
3212  if (!isset($urlparts['host'])) {
3213  $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] .
3214  substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
3215  }
3216  if (! in_array($url, $imported_urls)) {
3217  $this->parseWSDL($url);
3218  $imported++;
3219  $imported_urls[] = $url;
3220  }
3221  } else {
3222  $this->debug("Unexpected scenario: empty URL for unloaded import");
3223  }
3224  }
3225  }
3226  }
3227  }
3228  }
3229  // WSDL imports
3230  $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
3231  foreach ($this->import as $ns => $list) {
3232  for ($ii = 0; $ii < count($list); $ii++) {
3233  if (! $list[$ii]['loaded']) {
3234  $this->import[$ns][$ii]['loaded'] = true;
3235  $url = $list[$ii]['location'];
3236  if ($url != '') {
3237  $urlparts = parse_url($url);
3238  if (!isset($urlparts['host'])) {
3239  $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] .
3240  substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
3241  }
3242  if (! in_array($url, $imported_urls)) {
3243  $this->parseWSDL($url);
3244  $imported++;
3245  $imported_urls[] = $url;
3246  }
3247  } else {
3248  $this->debug("Unexpected scenario: empty URL for unloaded import");
3249  }
3250  }
3251  }
3252  }
3253  }
3254  // add new data to operation data
3255  foreach($this->bindings as $binding => $bindingData) {
3256  if (isset($bindingData['operations']) && is_array($bindingData['operations'])) {
3257  foreach($bindingData['operations'] as $operation => $data) {
3258  $this->debug('post-parse data gathering for ' . $operation);
3259  $this->bindings[$binding]['operations'][$operation]['input'] =
3260  isset($this->bindings[$binding]['operations'][$operation]['input']) ?
3261  array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) :
3262  $this->portTypes[ $bindingData['portType'] ][$operation]['input'];
3263  $this->bindings[$binding]['operations'][$operation]['output'] =
3264  isset($this->bindings[$binding]['operations'][$operation]['output']) ?
3265  array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) :
3266  $this->portTypes[ $bindingData['portType'] ][$operation]['output'];
3267  if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ])){
3268  $this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ];
3269  }
3270  if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ])){
3271  $this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ];
3272  }
3273  if (isset($bindingData['style'])) {
3274  $this->bindings[$binding]['operations'][$operation]['style'] = $bindingData['style'];
3275  }
3276  $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : '';
3277  $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : '';
3278  $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : '';
3279  }
3280  }
3281  }
3282  }
$proxyhost
Definition: nusoap.php:3162
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
$wsdl
Definition: nusoap.php:3135
parses a WSDL file, allows access to it&#39;s data, other utility methods
Definition: nusoap.php:3133
parseWSDL($wsdl='')
parses the wsdl document
Definition: nusoap.php:3290
$proxyusername
Definition: nusoap.php:3164
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$proxyport
Definition: nusoap.php:3163
$response_timeout
Definition: nusoap.php:3167
Create styles array
The data for the language used.
$timeout
Definition: nusoap.php:3166
$url
$binding
$proxypassword
Definition: nusoap.php:3165
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $authtype

wsdl::$authtype = ''

Definition at line 4551 of file nusoap.php.

◆ $bindings

wsdl::$bindings = array()

Definition at line 3146 of file nusoap.php.

◆ $certRequest

wsdl::$certRequest = array()

Definition at line 4552 of file nusoap.php.

◆ $complexTypes

wsdl::$complexTypes = array()

Definition at line 3140 of file nusoap.php.

◆ $curl_options

wsdl::$curl_options = array()

Definition at line 4546 of file nusoap.php.

◆ $currentBinding

wsdl::$currentBinding

Definition at line 3147 of file nusoap.php.

◆ $currentMessage

wsdl::$currentMessage

Definition at line 3142 of file nusoap.php.

◆ $currentOperation

wsdl::$currentOperation

Definition at line 3143 of file nusoap.php.

◆ $currentPort

wsdl::$currentPort

Definition at line 3149 of file nusoap.php.

◆ $currentPortType

wsdl::$currentPortType

Definition at line 3145 of file nusoap.php.

◆ $currentSchema

wsdl::$currentSchema

Definition at line 3138 of file nusoap.php.

◆ $depth

wsdl::$depth = 0

Definition at line 3159 of file nusoap.php.

◆ $depth_array

wsdl::$depth_array = array()

Definition at line 3160 of file nusoap.php.

◆ $documentation

wsdl::$documentation = false

Definition at line 3152 of file nusoap.php.

◆ $endpoint

wsdl::$endpoint = ''

Definition at line 3153 of file nusoap.php.

◆ $import

wsdl::$import = array()

Definition at line 3155 of file nusoap.php.

◆ $message

wsdl::$message = array()

Definition at line 3139 of file nusoap.php.

◆ $messages

wsdl::$messages = array()

Definition at line 3141 of file nusoap.php.

◆ $opData

wsdl::$opData = array()

Definition at line 3150 of file nusoap.php.

◆ $parser

wsdl::$parser

Definition at line 3157 of file nusoap.php.

◆ $password

wsdl::$password = ''

Definition at line 4550 of file nusoap.php.

◆ $ports

wsdl::$ports = array()

Definition at line 3148 of file nusoap.php.

◆ $portTypes

wsdl::$portTypes = array()

Definition at line 3144 of file nusoap.php.

◆ $position

wsdl::$position = 0

Definition at line 3158 of file nusoap.php.

◆ $proxyhost

wsdl::$proxyhost = ''

Definition at line 3162 of file nusoap.php.

◆ $proxypassword

wsdl::$proxypassword = ''

Definition at line 3165 of file nusoap.php.

◆ $proxyport

wsdl::$proxyport = ''

Definition at line 3163 of file nusoap.php.

◆ $proxyusername

wsdl::$proxyusername = ''

Definition at line 3164 of file nusoap.php.

◆ $response_timeout

wsdl::$response_timeout = 30

Definition at line 3167 of file nusoap.php.

◆ $schemas

wsdl::$schemas = array()

Definition at line 3137 of file nusoap.php.

◆ $status

wsdl::$status = ''

Definition at line 3151 of file nusoap.php.

◆ $timeout

wsdl::$timeout = 0

Definition at line 3166 of file nusoap.php.

◆ $use_curl

wsdl::$use_curl = false

Definition at line 4547 of file nusoap.php.

◆ $username

wsdl::$username = ''

Definition at line 4549 of file nusoap.php.

◆ $wsdl

wsdl::$wsdl

Definition at line 3135 of file nusoap.php.


The documentation for this class was generated from the following file: