ILIAS  release_7 Revision v7.30-3-g800a261c036
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 4572 of file nusoap.php.

References ILIAS\GlobalScreen\Provider\__construct(), and nusoap_base\debug().

4572  {
4574  $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
4575  $this->proxyhost = $proxyhost;
4576  $this->proxyport = $proxyport;
4577  $this->proxyusername = $proxyusername;
4578  $this->proxypassword = $proxypassword;
4579  $this->timeout = $timeout;
4580  $this->response_timeout = $response_timeout;
4581  if (is_array($curl_options))
4582  $this->curl_options = $curl_options;
4583  $this->use_curl = $use_curl;
4584  $this->fetchWSDL($wsdl);
4585  }
$proxyhost
Definition: nusoap.php:3162
$wsdl
Definition: nusoap.php:3135
$use_curl
Definition: nusoap.php:4551
$proxyusername
Definition: nusoap.php:3164
$curl_options
Definition: nusoap.php:4550
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
__construct(Container $dic, ilPlugin $plugin)
fetchWSDL($wsdl)
fetches the WSDL document and parses it
Definition: nusoap.php:4592
$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 Vendor\Package\$a, Vendor\Package\$e, $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:230
expandQname($qname)
expands a qualified name
Definition: nusoap.php:483
$n
Definition: RandomTest.php:85
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ 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 6261 of file nusoap.php.

References Vendor\Package\$a, Vendor\Package\$e, $n, $name, and nusoap_base\expandQname().

6261  {
6262  if (count($elements) > 0) {
6263  $eElements = array();
6264  foreach($elements as $n => $e){
6265  // expand each element
6266  $ee = array();
6267  foreach ($e as $k => $v) {
6268  $k = strpos($k,':') ? $this->expandQname($k) : $k;
6269  $v = strpos($v,':') ? $this->expandQname($v) : $v;
6270  $ee[$k] = $v;
6271  }
6272  $eElements[$n] = $ee;
6273  }
6274  $elements = $eElements;
6275  }
6276 
6277  if (count($attrs) > 0) {
6278  foreach($attrs as $n => $a){
6279  // expand each attribute
6280  foreach ($a as $k => $v) {
6281  $k = strpos($k,':') ? $this->expandQname($k) : $k;
6282  $v = strpos($v,':') ? $this->expandQname($v) : $v;
6283  $aa[$k] = $v;
6284  }
6285  $eAttrs[$n] = $aa;
6286  }
6287  $attrs = $eAttrs;
6288  }
6289 
6290  $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
6291  $arrayType = strpos($arrayType,':') ? $this->expandQname($arrayType) : $arrayType;
6292 
6293  $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6294  $this->schemas[$typens][0]->addComplexType($name,$typeClass,$phpType,$compositor,$restrictionBase,$elements,$attrs,$arrayType);
6295  }
if($format !==null) $name
Definition: metadata.php:230
expandQname($qname)
expands a qualified name
Definition: nusoap.php:483
$n
Definition: RandomTest.php:85
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ 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 6322 of file nusoap.php.

6322  {
6323  $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6324  $this->schemas[$typens][0]->addElement($attrs);
6325  }

◆ 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, 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
$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:230
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 6341 of file nusoap.php.

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

6341  {
6342  if ($use == 'encoded' && $encodingStyle == '') {
6343  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
6344  }
6345 
6346  if ($style == 'document') {
6347  $elements = array();
6348  foreach ($in as $n => $t) {
6349  $elements[$n] = array('name' => $n, 'type' => $t);
6350  }
6351  $this->addComplexType($name . 'RequestType', 'complexType', 'struct', 'all', '', $elements);
6352  $this->addElement(array('name' => $name, 'type' => $name . 'RequestType'));
6353  $in = array('parameters' => 'tns:' . $name . '^');
6354 
6355  $elements = array();
6356  foreach ($out as $n => $t) {
6357  $elements[$n] = array('name' => $n, 'type' => $t);
6358  }
6359  $this->addComplexType($name . 'ResponseType', 'complexType', 'struct', 'all', '', $elements);
6360  $this->addElement(array('name' => $name . 'Response', 'type' => $name . 'ResponseType', 'form' => 'qualified'));
6361  $out = array('parameters' => 'tns:' . $name . 'Response' . '^');
6362  }
6363 
6364  // get binding
6365  $this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] =
6366  array(
6367  'name' => $name,
6368  'binding' => $this->serviceName . 'Binding',
6369  'endpoint' => $this->endpoint,
6370  'soapAction' => $soapaction,
6371  'style' => $style,
6372  'input' => array(
6373  'use' => $use,
6374  'namespace' => $namespace,
6375  'encodingStyle' => $encodingStyle,
6376  'message' => $name . 'Request',
6377  'parts' => $in),
6378  'output' => array(
6379  'use' => $use,
6380  'namespace' => $namespace,
6381  'encodingStyle' => $encodingStyle,
6382  'message' => $name . 'Response',
6383  'parts' => $out),
6384  'namespace' => $namespace,
6385  'transport' => 'http://schemas.xmlsoap.org/soap/http',
6386  'documentation' => $documentation);
6387  // add portTypes
6388  // add messages
6389  if($in)
6390  {
6391  foreach($in as $pName => $pType)
6392  {
6393  if(strpos($pType,':')) {
6394  $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
6395  }
6396  $this->messages[$name.'Request'][$pName] = $pType;
6397  }
6398  } else {
6399  $this->messages[$name.'Request']= '0';
6400  }
6401  if($out)
6402  {
6403  foreach($out as $pName => $pType)
6404  {
6405  if(strpos($pType,':')) {
6406  $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
6407  }
6408  $this->messages[$name.'Response'][$pName] = $pType;
6409  }
6410  } else {
6411  $this->messages[$name.'Response']= '0';
6412  }
6413  return true;
6414  }
if($err=$client->getError()) $namespace
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:6322
if($format !==null) $name
Definition: metadata.php:230
$n
Definition: RandomTest.php:85
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:230
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 6308 of file nusoap.php.

References $name, and nusoap_base\expandQname().

6308  {
6309  $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
6310 
6311  $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6312  $this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType, $enumeration);
6313  }
if($format !==null) $name
Definition: metadata.php:230
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  }
$data
Definition: storeScorm.php:23
$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 5042 of file nusoap.php.

References $data.

5043  {
5044  $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0;
5045  if (isset($this->message[$pos]['cdata'])) {
5046  $this->message[$pos]['cdata'] .= $data;
5047  }
5048  if ($this->documentation) {
5049  $this->documentation .= $data;
5050  }
5051  }
$data
Definition: storeScorm.php:23
$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:230

◆ end_element() [2/2]

wsdl::end_element (   $parser,
  $name 
)

end-element handler

Parameters
string$parserXML parser object
string$nameelement name private

Definition at line 5012 of file nusoap.php.

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

5012  {
5013  // unset schema status
5014  if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
5015  $this->status = "";
5016  $this->appendDebug($this->currentSchema->getDebug());
5017  $this->currentSchema->clearDebug();
5018  $this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema;
5019  $this->debug('Parsing WSDL schema done');
5020  }
5021  if ($this->status == 'schema') {
5022  $this->currentSchema->schemaEndElement($parser, $name);
5023  } else {
5024  // bring depth down a notch
5025  $this->depth--;
5026  }
5027  // end documentation
5028  if ($this->documentation) {
5029  //TODO: track the node to which documentation should be assigned; it can be a part, message, etc.
5030  //$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation;
5031  $this->documentation = false;
5032  }
5033  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:298
$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:230
+ Here is the call graph for this function:

◆ fetchWSDL()

wsdl::fetchWSDL (   $wsdl)

fetches the WSDL document and parses it

public

Definition at line 4592 of file nusoap.php.

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

Referenced by nusoap_client\loadWSDL().

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

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

◆ getBindingData() [2/2]

wsdl::getBindingData (   $binding)

Definition at line 5071 of file nusoap.php.

5072  {
5073  if (is_array($this->bindings[$binding])) {
5074  return $this->bindings[$binding];
5075  }
5076  }

◆ 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 5116 of file nusoap.php.

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

Referenced by nusoap_server\invoke_method().

5148  {
5149  if ($bindingType == 'soap') {
5150  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
5151  } elseif ($bindingType == 'soap12') {
5152  $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
5153  }
5154  // loop thru ports
5155  foreach($this->ports as $port => $portData) {
5156  // binding type of port matches parameter
5157  if ($portData['bindingType'] == $bindingType) {
5158  // loop through operations for the binding
5159  foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
5160  if ($opData['soapAction'] == $soapAction) {
5161  return $opData;
5162  }
5163  }
5164  }
5165  }
5166  }
$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.

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  }
+ 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 5085 of file nusoap.php.

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

◆ 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 $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 5186 of file nusoap.php.

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

5186  {
5187  $this->debug("in getTypeDef: type=$type, ns=$ns");
5188  if ((! $ns) && isset($this->namespaces['tns'])) {
5189  $ns = $this->namespaces['tns'];
5190  $this->debug("in getTypeDef: type namespace forced to $ns");
5191  }
5192  if (!isset($this->schemas[$ns])) {
5193  foreach ($this->schemas as $ns0 => $schema0) {
5194  if (strcasecmp($ns, $ns0) == 0) {
5195  $this->debug("in getTypeDef: replacing schema namespace $ns with $ns0");
5196  $ns = $ns0;
5197  break;
5198  }
5199  }
5200  }
5201  if (isset($this->schemas[$ns])) {
5202  $this->debug("in getTypeDef: have schema for namespace $ns");
5203  for ($i = 0; $i < count($this->schemas[$ns]); $i++) {
5204  $xs = &$this->schemas[$ns][$i];
5205  $t = $xs->getTypeDef($type);
5206  //$this->appendDebug($xs->getDebug());
5207  //$xs->clearDebug();
5208  if ($t) {
5209  if (!isset($t['phpType'])) {
5210  // get info for type to tack onto the element
5211  $uqType = substr($t['type'], strrpos($t['type'], ':') + 1);
5212  $ns = substr($t['type'], 0, strrpos($t['type'], ':'));
5213  $etype = $this->getTypeDef($uqType, $ns);
5214  if ($etype) {
5215  $this->debug("found type for [element] $type:");
5216  $this->debug($this->varDump($etype));
5217  if (isset($etype['phpType'])) {
5218  $t['phpType'] = $etype['phpType'];
5219  }
5220  if (isset($etype['elements'])) {
5221  $t['elements'] = $etype['elements'];
5222  }
5223  if (isset($etype['attrs'])) {
5224  $t['attrs'] = $etype['attrs'];
5225  }
5226  }
5227  }
5228  return $t;
5229  }
5230  }
5231  } else {
5232  $this->debug("in getTypeDef: do not have schema for namespace $ns");
5233  }
5234  return false;
5235  }
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: metadata.php:24
+ 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 5527 of file nusoap.php.

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

5527  {
5528  $this->debug("in parametersMatchWrapped type=$type, parameters=");
5529  $this->appendDebug($this->varDump($parameters));
5530 
5531  // split type into namespace:unqualified-type
5532  if (strpos($type, ':')) {
5533  $uqType = substr($type, strrpos($type, ':') + 1);
5534  $ns = substr($type, 0, strrpos($type, ':'));
5535  $this->debug("in parametersMatchWrapped: got a prefixed type: $uqType, $ns");
5536  if ($this->getNamespaceFromPrefix($ns)) {
5537  $ns = $this->getNamespaceFromPrefix($ns);
5538  $this->debug("in parametersMatchWrapped: expanded prefixed type: $uqType, $ns");
5539  }
5540  } else {
5541  // TODO: should the type be compared to types in XSD, and the namespace
5542  // set to XSD if the type matches?
5543  $this->debug("in parametersMatchWrapped: No namespace for type $type");
5544  $ns = '';
5545  $uqType = $type;
5546  }
5547 
5548  // get the type information
5549  if (!$typeDef = $this->getTypeDef($uqType, $ns)) {
5550  $this->debug("in parametersMatchWrapped: $type ($uqType) is not a supported type.");
5551  return false;
5552  }
5553  $this->debug("in parametersMatchWrapped: found typeDef=");
5554  $this->appendDebug($this->varDump($typeDef));
5555  if (substr($uqType, -1) == '^') {
5556  $uqType = substr($uqType, 0, -1);
5557  }
5558  $phpType = $typeDef['phpType'];
5559  $arrayType = (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '');
5560  $this->debug("in parametersMatchWrapped: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: $arrayType");
5561 
5562  // we expect a complexType or element of complexType
5563  if ($phpType != 'struct') {
5564  $this->debug("in parametersMatchWrapped: not a struct");
5565  return false;
5566  }
5567 
5568  // see whether the parameter names match the elements
5569  if (isset($typeDef['elements']) && is_array($typeDef['elements'])) {
5570  $elements = 0;
5571  $matches = 0;
5572  $change = false;
5573  if ($this->isArraySimpleOrStruct($parameters) == 'arraySimple' && count($parameters) == count($typeDef['elements'])) {
5574  $this->debug("in parametersMatchWrapped: (wrapped return value kludge) correct number of elements in simple array, so change array and wrap");
5575  $change = true;
5576  }
5577  foreach ($typeDef['elements'] as $name => $attrs) {
5578  if ($change) {
5579  $this->debug("in parametersMatchWrapped: change parameter $element to name $name");
5580  $parameters[$name] = $parameters[$elements];
5581  unset($parameters[$elements]);
5582  $matches++;
5583  } elseif (isset($parameters[$name])) {
5584  $this->debug("in parametersMatchWrapped: have parameter named $name");
5585  $matches++;
5586  } else {
5587  $this->debug("in parametersMatchWrapped: do not have parameter named $name");
5588  }
5589  $elements++;
5590  }
5591 
5592  $this->debug("in parametersMatchWrapped: $matches parameter names match $elements wrapped parameter names");
5593  if ($matches == 0) {
5594  return false;
5595  }
5596  return true;
5597  }
5598 
5599  // since there are no elements for the type, if the user passed no
5600  // parameters, the parameters match wrapped.
5601  $this->debug("in parametersMatchWrapped: no elements type $ns:$uqType");
5602  return count($parameters) == 0;
5603  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:298
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:230
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
$data
Definition: storeScorm.php:23
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 4695 of file nusoap.php.

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

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

◆ serialize() [1/2]

wsdl::serialize ( )

serialize the parsed wsdl

Returns
string , serialization of WSDL public

Definition at line 3741 of file nusoap.php.

References 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  }
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed ...
Definition: nusoap.php:508
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:557
$xml
Definition: metadata.php:332
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 5383 of file nusoap.php.

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

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

◆ 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 6097 of file nusoap.php.

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

6097  {
6098  $xml = '';
6099  if (isset($typeDef['attrs']) && is_array($typeDef['attrs'])) {
6100  $this->debug("serialize attributes for XML Schema type $ns:$uqType");
6101  if (is_array($value)) {
6102  $xvalue = $value;
6103  } elseif (is_object($value)) {
6104  $xvalue = get_object_vars($value);
6105  } else {
6106  $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
6107  $xvalue = array();
6108  }
6109  foreach ($typeDef['attrs'] as $aName => $attrs) {
6110  if (isset($xvalue['!' . $aName])) {
6111  $xname = '!' . $aName;
6112  $this->debug("value provided for attribute $aName with key $xname");
6113  } elseif (isset($xvalue[$aName])) {
6114  $xname = $aName;
6115  $this->debug("value provided for attribute $aName with key $xname");
6116  } elseif (isset($attrs['default'])) {
6117  $xname = '!' . $aName;
6118  $xvalue[$xname] = $attrs['default'];
6119  $this->debug('use default value of ' . $xvalue[$aName] . ' for attribute ' . $aName);
6120  } else {
6121  $xname = '';
6122  $this->debug("no value provided for attribute $aName");
6123  }
6124  if ($xname) {
6125  $xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\"";
6126  }
6127  }
6128  } else {
6129  $this->debug("no attributes to serialize for XML Schema type $ns:$uqType");
6130  }
6131  if (isset($typeDef['extensionBase'])) {
6132  $ns = $this->getPrefix($typeDef['extensionBase']);
6133  $uqType = $this->getLocalPart($typeDef['extensionBase']);
6134  if ($this->getNamespaceFromPrefix($ns)) {
6135  $ns = $this->getNamespaceFromPrefix($ns);
6136  }
6137  if ($typeDef = $this->getTypeDef($uqType, $ns)) {
6138  $this->debug("serialize attributes for extension base $ns:$uqType");
6139  $xml .= $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
6140  } else {
6141  $this->debug("extension base $ns:$uqType is not a supported type");
6142  }
6143  }
6144  return $xml;
6145  }
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:332
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:6097
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 6159 of file nusoap.php.

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

6159  {
6160  $xml = '';
6161  if (isset($typeDef['elements']) && is_array($typeDef['elements'])) {
6162  $this->debug("in serializeComplexTypeElements, serialize elements for XML Schema type $ns:$uqType");
6163  if (is_array($value)) {
6164  $xvalue = $value;
6165  } elseif (is_object($value)) {
6166  $xvalue = get_object_vars($value);
6167  } else {
6168  $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
6169  $xvalue = array();
6170  }
6171  // toggle whether all elements are present - ideally should validate against schema
6172  if (count($typeDef['elements']) != count($xvalue)){
6173  $optionals = true;
6174  }
6175  foreach ($typeDef['elements'] as $eName => $attrs) {
6176  if (!isset($xvalue[$eName])) {
6177  if (isset($attrs['default'])) {
6178  $xvalue[$eName] = $attrs['default'];
6179  $this->debug('use default value of ' . $xvalue[$eName] . ' for element ' . $eName);
6180  }
6181  }
6182  // if user took advantage of a minOccurs=0, then only serialize named parameters
6183  if (isset($optionals)
6184  && (!isset($xvalue[$eName]))
6185  && ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
6186  ){
6187  if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') {
6188  $this->debug("apparent error: no value provided for element $eName with minOccurs=" . $attrs['minOccurs']);
6189  }
6190  // do nothing
6191  $this->debug("no value provided for complexType element $eName and element is not nillable, so serialize nothing");
6192  } else {
6193  // get value
6194  if (isset($xvalue[$eName])) {
6195  $v = $xvalue[$eName];
6196  } else {
6197  $v = null;
6198  }
6199  if (isset($attrs['form'])) {
6200  $unqualified = ($attrs['form'] == 'unqualified');
6201  } else {
6202  $unqualified = false;
6203  }
6204  if (isset($attrs['maxOccurs']) && ($attrs['maxOccurs'] == 'unbounded' || $attrs['maxOccurs'] > 1) && isset($v) && is_array($v) && $this->isArraySimpleOrStruct($v) == 'arraySimple') {
6205  $vv = $v;
6206  foreach ($vv as $k => $v) {
6207  if (isset($attrs['type']) || isset($attrs['ref'])) {
6208  // serialize schema-defined type
6209  $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
6210  } else {
6211  // serialize generic type (can this ever really happen?)
6212  $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
6213  $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
6214  }
6215  }
6216  } else {
6217  if (isset($attrs['type']) || isset($attrs['ref'])) {
6218  // serialize schema-defined type
6219  $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
6220  } else {
6221  // serialize generic type (can this ever really happen?)
6222  $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
6223  $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
6224  }
6225  }
6226  }
6227  }
6228  } else {
6229  $this->debug("no elements to serialize for XML Schema type $ns:$uqType");
6230  }
6231  if (isset($typeDef['extensionBase'])) {
6232  $ns = $this->getPrefix($typeDef['extensionBase']);
6233  $uqType = $this->getLocalPart($typeDef['extensionBase']);
6234  if ($this->getNamespaceFromPrefix($ns)) {
6235  $ns = $this->getNamespaceFromPrefix($ns);
6236  }
6237  if ($typeDef = $this->getTypeDef($uqType, $ns)) {
6238  $this->debug("serialize elements for extension base $ns:$uqType");
6239  $xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle);
6240  } else {
6241  $this->debug("extension base $ns:$uqType is not a supported type");
6242  }
6243  }
6244  return $xml;
6245  }
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:6159
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:332
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
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
if($format !==null) $name
Definition: metadata.php:230
$xml
Definition: metadata.php:332
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 5714 of file nusoap.php.

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

5715  {
5716  $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion");
5717  $this->appendDebug('parameters=' . $this->varDump($parameters));
5718 
5719  if ($direction != 'input' && $direction != 'output') {
5720  $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
5721  $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
5722  return false;
5723  }
5724  if (!$opData = $this->getOperationData($operation)) {
5725  $this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
5726  $this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
5727  return false;
5728  }
5729  $this->debug('opData:');
5730  $this->appendDebug($this->varDump($opData));
5731 
5732  // Get encoding style for output and set to current
5733  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
5734  if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
5735  $encodingStyle = $opData['output']['encodingStyle'];
5736  $enc_style = $encodingStyle;
5737  }
5738 
5739  // set input params
5740  $xml = '';
5741  if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
5742 
5743  $use = $opData[$direction]['use'];
5744  $this->debug("use=$use");
5745  $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
5746  if (is_array($parameters)) {
5747  $parametersArrayType = $this->isArraySimpleOrStruct($parameters);
5748  $this->debug('have ' . $parametersArrayType . ' parameters');
5749  foreach($opData[$direction]['parts'] as $name => $type) {
5750  $this->debug('serializing part "'.$name.'" of type "'.$type.'"');
5751  // Track encoding style
5752  if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
5753  $encodingStyle = $opData[$direction]['encodingStyle'];
5754  $enc_style = $encodingStyle;
5755  } else {
5756  $enc_style = false;
5757  }
5758  // NOTE: add error handling here
5759  // if serializeType returns false, then catch global error and fault
5760  if ($parametersArrayType == 'arraySimple') {
5761  $p = array_shift($parameters);
5762  $this->debug('calling serializeType w/indexed param');
5763  $xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
5764  } elseif (isset($parameters[$name])) {
5765  $this->debug('calling serializeType w/named param');
5766  $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
5767  } else {
5768  // TODO: only send nillable
5769  $this->debug('calling serializeType w/null param');
5770  $xml .= $this->serializeType($name, $type, null, $use, $enc_style);
5771  }
5772  }
5773  } else {
5774  $this->debug('no parameters passed.');
5775  }
5776  }
5777  $this->debug("serializeParameters returning: $xml");
5778  return $xml;
5779  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:298
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
if($format !==null) $name
Definition: metadata.php:230
$xml
Definition: metadata.php:332
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
if($format !==null) $name
Definition: metadata.php:230
$xml
Definition: metadata.php:332
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 5620 of file nusoap.php.

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

5620  {
5621  $this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType");
5622  $this->appendDebug('parameters=' . $this->varDump($parameters));
5623 
5624  if ($direction != 'input' && $direction != 'output') {
5625  $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
5626  $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
5627  return false;
5628  }
5629  if (!$opData = $this->getOperationData($operation, $bindingType)) {
5630  $this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
5631  $this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
5632  return false;
5633  }
5634  $this->debug('in serializeRPCParameters: opData:');
5635  $this->appendDebug($this->varDump($opData));
5636 
5637  // Get encoding style for output and set to current
5638  $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
5639  if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
5640  $encodingStyle = $opData['output']['encodingStyle'];
5641  $enc_style = $encodingStyle;
5642  }
5643 
5644  // set input params
5645  $xml = '';
5646  if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
5647  $parts = &$opData[$direction]['parts'];
5648  $part_count = sizeof($parts);
5649  $style = $opData['style'];
5650  $use = $opData[$direction]['use'];
5651  $this->debug("have $part_count part(s) to serialize using $style/$use");
5652  if (is_array($parameters)) {
5653  $parametersArrayType = $this->isArraySimpleOrStruct($parameters);
5654  $parameter_count = count($parameters);
5655  $this->debug("have $parameter_count parameter(s) provided as $parametersArrayType to serialize");
5656  // check for Microsoft-style wrapped parameters
5657  if ($style == 'document' && $use == 'literal' && $part_count == 1 && isset($parts['parameters'])) {
5658  $this->debug('check whether the caller has wrapped the parameters');
5659  if ((($parametersArrayType == 'arrayStruct' || $parameter_count == 0) && !isset($parameters['parameters'])) || ($direction == 'output' && $parametersArrayType == 'arraySimple' && $parameter_count == 1)) {
5660  $this->debug('check whether caller\'s parameters match the wrapped ones');
5661  if ($this->parametersMatchWrapped($parts['parameters'], $parameters)) {
5662  $this->debug('wrap the parameters for the caller');
5663  $parameters = array('parameters' => $parameters);
5664  $parameter_count = 1;
5665  }
5666  }
5667  }
5668  foreach ($parts as $name => $type) {
5669  $this->debug("serializing part $name of type $type");
5670  // Track encoding style
5671  if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
5672  $encodingStyle = $opData[$direction]['encodingStyle'];
5673  $enc_style = $encodingStyle;
5674  } else {
5675  $enc_style = false;
5676  }
5677  // NOTE: add error handling here
5678  // if serializeType returns false, then catch global error and fault
5679  if ($parametersArrayType == 'arraySimple') {
5680  $p = array_shift($parameters);
5681  $this->debug('calling serializeType w/indexed param');
5682  $xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
5683  } elseif (isset($parameters[$name])) {
5684  $this->debug('calling serializeType w/named param');
5685  $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
5686  } else {
5687  // TODO: only send nillable
5688  $this->debug('calling serializeType w/null param');
5689  $xml .= $this->serializeType($name, $type, null, $use, $enc_style);
5690  }
5691  }
5692  } else {
5693  $this->debug('no parameters passed.');
5694  }
5695  }
5696  $this->debug("serializeRPCParameters returning: $xml");
5697  return $xml;
5698  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:298
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
if($format !==null) $name
Definition: metadata.php:230
$xml
Definition: metadata.php:332
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:5527
+ 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, $name, $rows, $type, $xml, 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
if($format !==null) $name
Definition: metadata.php:230
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:557
$xml
Definition: metadata.php:332
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
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 5793 of file nusoap.php.

References $cols, $n, $name, $rows, $type, $xml, nusoap_base\appendDebug(), 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().

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

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

Referenced by nusoap_client\loadWSDL().

5062  {
5063  $this->debug("setCredentials username=$username authtype=$authtype certRequest=");
5064  $this->appendDebug($this->varDump($certRequest));
5065  $this->username = $username;
5066  $this->password = $password;
5067  $this->authtype = $authtype;
5068  $this->certRequest = $certRequest;
5069  }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:298
debug($string)
adds debug data to the class level debug string
Definition: nusoap.php:144
$password
Definition: nusoap.php:4554
$authtype
Definition: nusoap.php:4555
$username
Definition: nusoap.php:4553
varDump($data)
Definition: nusoap.php:567
$certRequest
Definition: nusoap.php:4556
+ 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 $name, $namespace, 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
if($format !==null) $name
Definition: metadata.php:230
$currentPort
Definition: nusoap.php:3149
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
$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 4799 of file nusoap.php.

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

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

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

Referenced by nusoap_server\service().

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

◆ $bindings

wsdl::$bindings = array()

Definition at line 3146 of file nusoap.php.

◆ $certRequest

wsdl::$certRequest = array()

Definition at line 4556 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 4550 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 4554 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 4551 of file nusoap.php.

◆ $username

wsdl::$username = ''

Definition at line 4553 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: