ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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

 __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
 __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

 $serviceName
 
 $opStatus
 
 $currentPortOperation
 
 $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.7.3'
 
 $revision = '$Revision$'
 
 $error_str = ''
 
 $debug_str = ''
 
 $charencoding = true
 
 $debugLevel
 
 $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'
 
 $soap_defencoding = 'UTF-8'
 
 $namespaces
 
 $usedNamespaces = array()
 
 $typemap
 
 $xmlEntities
 

Detailed Description

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

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$ @access public

Definition at line 4583 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 @access public

Definition at line 4644 of file nusoap.php.

4645 {
4647 $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
4648 $this->proxyhost = $proxyhost;
4649 $this->proxyport = $proxyport;
4650 $this->proxyusername = $proxyusername;
4651 $this->proxypassword = $proxypassword;
4652 $this->timeout = $timeout;
4653 $this->response_timeout = $response_timeout;
4654 if (is_array($curl_options)) {
4655 $this->curl_options = $curl_options;
4656 }
4657 $this->use_curl = $use_curl;
4658 $this->fetchWSDL($wsdl);
4659 }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
$proxyhost
Definition: nusoap.php:4616
$proxypassword
Definition: nusoap.php:4619
fetchWSDL($wsdl)
fetches the WSDL document and parses it
Definition: nusoap.php:4666
$wsdl
Definition: nusoap.php:4589
$timeout
Definition: nusoap.php:4620
$use_curl
Definition: nusoap.php:4623
$proxyusername
Definition: nusoap.php:4618
$proxyport
Definition: nusoap.php:4617
$curl_options
Definition: nusoap.php:4622
$response_timeout
Definition: nusoap.php:4621
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $curl_options, $proxyhost, $proxypassword, $proxyport, $proxyusername, $response_timeout, $timeout, $use_curl, $wsdl, ILIAS\GlobalScreen\Provider\__construct(), nusoap_base\debug(), and fetchWSDL().

+ Here is the call graph for this function:

Member Function Documentation

◆ addComplexType()

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 @access public

Definition at line 6349 of file nusoap.php.

6350 {
6351 if (count($elements) > 0) {
6352 $eElements = array();
6353 foreach ($elements as $n => $e) {
6354 // expand each element
6355 $ee = array();
6356 foreach ($e as $k => $v) {
6357 $k = strpos($k, ':') ? $this->expandQname($k) : $k;
6358 $v = strpos($v, ':') ? $this->expandQname($v) : $v;
6359 $ee[$k] = $v;
6360 }
6361 $eElements[$n] = $ee;
6362 }
6363 $elements = $eElements;
6364 }
6365
6366 if (count($attrs) > 0) {
6367 foreach ($attrs as $n => $a) {
6368 // expand each attribute
6369 foreach ($a as $k => $v) {
6370 $k = strpos($k, ':') ? $this->expandQname($k) : $k;
6371 $v = strpos($v, ':') ? $this->expandQname($v) : $v;
6372 $aa[$k] = $v;
6373 }
6374 $eAttrs[$n] = $aa;
6375 }
6376 $attrs = $eAttrs;
6377 }
6378
6379 $restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
6380 $arrayType = strpos($arrayType, ':') ? $this->expandQname($arrayType) : $arrayType;
6381
6382 $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6383 $this->schemas[$typens][0]->addComplexType($name, $typeClass, $phpType, $compositor, $restrictionBase, $elements, $attrs, $arrayType);
6384 }
expandQname($qname)
expands (changes prefix to namespace) a qualified name
Definition: nusoap.php:753
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

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

Referenced by addOperation().

+ Here is the call graph for this function:
+ Here is the caller 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 @access public

Definition at line 6412 of file nusoap.php.

6413 {
6414 $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6415 $this->schemas[$typens][0]->addElement($attrs);
6416 }

Referenced by addOperation().

+ Here is the caller graph for this function:

◆ addOperation()

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) @access public

Definition at line 6432 of file nusoap.php.

6433 {
6434 if ($use == 'encoded' && $encodingStyle == '') {
6435 $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
6436 }
6437
6438 if ($style == 'document') {
6439 $elements = array();
6440 foreach ($in as $n => $t) {
6441 $elements[$n] = array('name' => $n, 'type' => $t);
6442 }
6443 $this->addComplexType($name . 'RequestType', 'complexType', 'struct', 'all', '', $elements);
6444 $this->addElement(array('name' => $name, 'type' => $name . 'RequestType'));
6445 $in = array('parameters' => 'tns:' . $name . '^');
6446
6447 $elements = array();
6448 foreach ($out as $n => $t) {
6449 $elements[$n] = array('name' => $n, 'type' => $t);
6450 }
6451 $this->addComplexType($name . 'ResponseType', 'complexType', 'struct', 'all', '', $elements);
6452 $this->addElement(array('name' => $name . 'Response', 'type' => $name . 'ResponseType', 'form' => 'qualified'));
6453 $out = array('parameters' => 'tns:' . $name . 'Response' . '^');
6454 }
6455
6456 // get binding
6457 $this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] =
6458 array(
6459 'name' => $name,
6460 'binding' => $this->serviceName . 'Binding',
6461 'endpoint' => $this->endpoint,
6462 'soapAction' => $soapaction,
6463 'style' => $style,
6464 'input' => array(
6465 'use' => $use,
6466 'namespace' => $namespace,
6467 'encodingStyle' => $encodingStyle,
6468 'message' => $name . 'Request',
6469 'parts' => $in),
6470 'output' => array(
6471 'use' => $use,
6472 'namespace' => $namespace,
6473 'encodingStyle' => $encodingStyle,
6474 'message' => $name . 'Response',
6475 'parts' => $out),
6476 'namespace' => $namespace,
6477 'transport' => 'http://schemas.xmlsoap.org/soap/http',
6478 'documentation' => $documentation);
6479 // add portTypes
6480 // add messages
6481 if ($in) {
6482 foreach ($in as $pName => $pType) {
6483 if (strpos($pType, ':')) {
6484 $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)) . ":" . $this->getLocalPart($pType);
6485 }
6486 $this->messages[$name . 'Request'][$pName] = $pType;
6487 }
6488 } else {
6489 $this->messages[$name . 'Request'] = '0';
6490 }
6491 if ($out) {
6492 foreach ($out as $pName => $pType) {
6493 if (strpos($pType, ':')) {
6494 $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)) . ":" . $this->getLocalPart($pType);
6495 }
6496 $this->messages[$name . 'Response'][$pName] = $pType;
6497 }
6498 } else {
6499 $this->messages[$name . 'Response'] = '0';
6500 }
6501 return true;
6502 }
$out
Definition: buildRTE.php:24
getPrefix($str)
returns the prefix part of a prefixed string returns false, if not prefixed
Definition: nusoap.php:797
getNamespaceFromPrefix($prefix)
pass it a prefix, it returns a namespace
Definition: nusoap.php:813
getLocalPart($str)
returns the local part of a prefixed string returns the original string, if not prefixed
Definition: nusoap.php:779
addElement($attrs)
adds an element to the WSDL types
Definition: nusoap.php:6412
$documentation
Definition: nusoap.php:4606
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:6349
if($err=$client->getError()) $namespace

References $documentation, $namespace, $out, addComplexType(), addElement(), nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), and nusoap_base\getPrefix().

Referenced by nusoap_server\register().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSimpleType()

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 @access public

Definition at line 6397 of file nusoap.php.

6398 {
6399 $restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
6400
6401 $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6402 $this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType, $enumeration);
6403 }

References nusoap_base\expandQname().

+ Here is the call graph for this function:

◆ character_data()

wsdl::character_data (   $parser,
  $data 
)

element content handler

Parameters
string$parserXML parser object
string$dataelement content @access private

Definition at line 5118 of file nusoap.php.

5119 {
5120 $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0;
5121 if (isset($this->message[$pos]['cdata'])) {
5122 $this->message[$pos]['cdata'] .= $data;
5123 }
5124 if ($this->documentation) {
5125 $this->documentation .= $data;
5126 }
5127 }
$depth
Definition: nusoap.php:4613

References $data, and $depth.

Referenced by parseWSDL().

+ Here is the caller graph for this function:

◆ end_element()

wsdl::end_element (   $parser,
  $name 
)

end-element handler

Parameters
string$parserXML parser object
string$nameelement name @access private

Definition at line 5087 of file nusoap.php.

5088 {
5089 // unset schema status
5090 if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
5091 $this->status = "";
5092 $this->appendDebug($this->currentSchema->getDebug());
5093 $this->currentSchema->clearDebug();
5094 $this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema;
5095 $this->debug('Parsing WSDL schema done');
5096 }
5097 if ($this->status == 'schema') {
5098 $this->currentSchema->schemaEndElement($parser, $name);
5099 } else {
5100 // bring depth down a notch
5101 $this->depth--;
5102 }
5103 // end documentation
5104 if ($this->documentation) {
5105 //TODO: track the node to which documentation should be assigned; it can be a part, message, etc.
5106 //$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation;
5107 $this->documentation = false;
5108 }
5109 }
appendDebug($string)
adds debug data to the instance debug string without formatting
Definition: nusoap.php:263
$currentSchema
Definition: nusoap.php:4592
$parser
Definition: nusoap.php:4611

References $currentSchema, $parser, nusoap_base\appendDebug(), and nusoap_base\debug().

Referenced by parseWSDL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchWSDL()

wsdl::fetchWSDL (   $wsdl)

fetches the WSDL document and parses it

@access public

Definition at line 4666 of file nusoap.php.

4667 {
4668 $this->debug("parse and process WSDL path=$wsdl");
4669 $this->wsdl = $wsdl;
4670 // parse wsdl file
4671 if ($this->wsdl != "") {
4672 $this->parseWSDL($this->wsdl);
4673 }
4674 // imports
4675 // TODO: handle imports more properly, grabbing them in-line and nesting them
4676 $imported_urls = array();
4677 $imported = 1;
4678 while ($imported > 0) {
4679 $imported = 0;
4680 // Schema imports
4681 foreach ($this->schemas as $ns => $list) {
4682 foreach ($list as $xs) {
4683 $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
4684 foreach ($xs->imports as $ns2 => $list2) {
4685 for ($ii = 0; $ii < count($list2); $ii++) {
4686 if (! $list2[$ii]['loaded']) {
4687 $this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true;
4688 $url = $list2[$ii]['location'];
4689 if ($url != '') {
4690 $urlparts = parse_url($url);
4691 if (!isset($urlparts['host'])) {
4692 $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') .
4693 substr($wsdlparts['path'], 0, strrpos($wsdlparts['path'], '/') + 1) . $urlparts['path'];
4694 }
4695 if (! in_array($url, $imported_urls)) {
4696 $this->parseWSDL($url);
4697 $imported++;
4698 $imported_urls[] = $url;
4699 }
4700 } else {
4701 $this->debug("Unexpected scenario: empty URL for unloaded import");
4702 }
4703 }
4704 }
4705 }
4706 }
4707 }
4708 // WSDL imports
4709 $wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
4710 foreach ($this->import as $ns => $list) {
4711 for ($ii = 0; $ii < count($list); $ii++) {
4712 if (! $list[$ii]['loaded']) {
4713 $this->import[$ns][$ii]['loaded'] = true;
4714 $url = $list[$ii]['location'];
4715 if ($url != '') {
4716 $urlparts = parse_url($url);
4717 if (!isset($urlparts['host'])) {
4718 $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') .
4719 substr($wsdlparts['path'], 0, strrpos($wsdlparts['path'], '/') + 1) . $urlparts['path'];
4720 }
4721 if (! in_array($url, $imported_urls)) {
4722 $this->parseWSDL($url);
4723 $imported++;
4724 $imported_urls[] = $url;
4725 }
4726 } else {
4727 $this->debug("Unexpected scenario: empty URL for unloaded import");
4728 }
4729 }
4730 }
4731 }
4732 }
4733 // add new data to operation data
4734 foreach ($this->bindings as $binding => $bindingData) {
4735 if (isset($bindingData['operations']) && is_array($bindingData['operations'])) {
4736 foreach ($bindingData['operations'] as $operation => $data) {
4737 $this->debug('post-parse data gathering for ' . $operation);
4738 $this->bindings[$binding]['operations'][$operation]['input'] =
4739 isset($this->bindings[$binding]['operations'][$operation]['input']) ?
4740 array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) :
4741 $this->portTypes[ $bindingData['portType'] ][$operation]['input'];
4742 $this->bindings[$binding]['operations'][$operation]['output'] =
4743 isset($this->bindings[$binding]['operations'][$operation]['output']) ?
4744 array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) :
4745 $this->portTypes[ $bindingData['portType'] ][$operation]['output'];
4746 if (isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ])) {
4747 $this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ];
4748 }
4749 if (isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ])) {
4750 $this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ];
4751 }
4752 // Set operation style if necessary, but do not override one already provided
4753 if (isset($bindingData['style']) && !isset($this->bindings[$binding]['operations'][$operation]['style'])) {
4754 $this->bindings[$binding]['operations'][$operation]['style'] = $bindingData['style'];
4755 }
4756 $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : '';
4757 $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : '';
4758 $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : '';
4759 }
4760 }
4761 }
4762 }
parses a WSDL file, allows access to it's data, other utility methods.
Definition: nusoap.php:4584
parseWSDL($wsdl='')
parses the wsdl document
Definition: nusoap.php:4770
$url
Definition: shib_logout.php:68

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

Referenced by __construct(), and nusoap_client\loadWSDL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBindingData()

wsdl::getBindingData (   $binding)

Definition at line 5148 of file nusoap.php.

5149 {
5150 if (is_array($this->bindings[$binding])) {
5151 return $this->bindings[$binding];
5152 }
5153 }

◆ getOperationData()

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 @access public

Definition at line 5194 of file nusoap.php.

5195 {
5196 if ($bindingType == 'soap') {
5197 $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
5198 } elseif ($bindingType == 'soap12') {
5199 $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
5200 }
5201 // loop thru ports
5202 foreach ($this->ports as $port => $portData) {
5203 // binding type of port matches parameter
5204 if ($portData['bindingType'] == $bindingType) {
5205 // get binding
5206 //foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
5207 foreach (array_keys($this->bindings[ $portData['binding'] ]['operations']) as $bOperation) {
5208 // note that we could/should also check the namespace here
5209 if ($operation == $bOperation) {
5210 $opData = $this->bindings[ $portData['binding'] ]['operations'][$operation];
5211 return $opData;
5212 }
5213 }
5214 }
5215 }
5216 }
$opData
Definition: nusoap.php:4604

References $opData.

Referenced by nusoap_server\invoke_method(), serializeParameters(), serializeRPCParameters(), and nusoap_server\verify_method().

+ Here is the caller graph for this function:

◆ 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 @access public

Definition at line 5226 of file nusoap.php.

5227 {
5228 if ($bindingType == 'soap') {
5229 $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
5230 } elseif ($bindingType == 'soap12') {
5231 $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
5232 }
5233 // loop thru ports
5234 foreach ($this->ports as $port => $portData) {
5235 // binding type of port matches parameter
5236 if ($portData['bindingType'] == $bindingType) {
5237 // loop through operations for the binding
5238 foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
5239 if ($opData['soapAction'] == $soapAction) {
5240 return $opData;
5241 }
5242 }
5243 }
5244 }
5245 }

References $opData.

Referenced by nusoap_server\invoke_method().

+ Here is the caller graph for this function:

◆ getOperations()

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 @access public

Definition at line 5162 of file nusoap.php.

5163 {
5164 $ops = array();
5165 if ($bindingType == 'soap') {
5166 $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
5167 } elseif ($bindingType == 'soap12') {
5168 $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
5169 }
5170 // loop thru ports
5171 foreach ($this->ports as $port => $portData) {
5172 // binding type of port matches parameter
5173 if ($portData['bindingType'] == $bindingType) {
5174 //$this->debug("getOperations for port $port");
5175 //$this->debug("port data: " . $this->varDump($portData));
5176 //$this->debug("bindings: " . $this->varDump($this->bindings[ $portData['binding'] ]));
5177 // merge bindings
5178 if (isset($this->bindings[ $portData['binding'] ]['operations'])) {
5179 $ops = array_merge($ops, $this->bindings[ $portData['binding'] ]['operations']);
5180 }
5181 }
5182 }
5183 return $ops;
5184 }

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

+ Here is the caller graph for this function:

◆ getTypeDef()

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 @access public
See also
nusoap_xmlschema

Definition at line 5265 of file nusoap.php.

5266 {
5267 $this->debug("in getTypeDef: type=$type, ns=$ns");
5268 if ((! $ns) && isset($this->namespaces['tns'])) {
5269 $ns = $this->namespaces['tns'];
5270 $this->debug("in getTypeDef: type namespace forced to $ns");
5271 }
5272 if (!isset($this->schemas[$ns])) {
5273 foreach ($this->schemas as $ns0 => $schema0) {
5274 if (strcasecmp($ns, $ns0) == 0) {
5275 $this->debug("in getTypeDef: replacing schema namespace $ns with $ns0");
5276 $ns = $ns0;
5277 break;
5278 }
5279 }
5280 }
5281 if (isset($this->schemas[$ns])) {
5282 $this->debug("in getTypeDef: have schema for namespace $ns");
5283 for ($i = 0; $i < count($this->schemas[$ns]); $i++) {
5284 $xs = &$this->schemas[$ns][$i];
5285 $t = $xs->getTypeDef($type);
5286 //$this->appendDebug($xs->getDebug());
5287 //$xs->clearDebug();
5288 if ($t) {
5289 if (!isset($t['phpType'])) {
5290 // get info for type to tack onto the element
5291 $uqType = substr($t['type'], strrpos($t['type'], ':') + 1);
5292 $ns = substr($t['type'], 0, strrpos($t['type'], ':'));
5293 $etype = $this->getTypeDef($uqType, $ns);
5294 if ($etype) {
5295 $this->debug("found type for [element] $type:");
5296 $this->debug($this->varDump($etype));
5297 if (isset($etype['phpType'])) {
5298 $t['phpType'] = $etype['phpType'];
5299 }
5300 if (isset($etype['elements'])) {
5301 $t['elements'] = $etype['elements'];
5302 }
5303 if (isset($etype['attrs'])) {
5304 $t['attrs'] = $etype['attrs'];
5305 }
5306 }
5307 }
5308 return $t;
5309 }
5310 }
5311 } else {
5312 $this->debug("in getTypeDef: do not have schema for namespace $ns");
5313 }
5314 return false;
5315 }
varDump($data)
Returns a string with the output of var_dump.
Definition: nusoap.php:867
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:5265

References nusoap_base\debug(), getTypeDef(), and nusoap_base\varDump().

Referenced by getTypeDef(), parametersMatchWrapped(), serialize(), serializeComplexTypeAttributes(), serializeComplexTypeElements(), and serializeType().

+ Here is the call graph for this function:
+ Here is the caller 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) @access private

Definition at line 5612 of file nusoap.php.

5613 {
5614 $this->debug("in parametersMatchWrapped type=$type, parameters=");
5615 $this->appendDebug($this->varDump($parameters));
5616
5617 // split type into namespace:unqualified-type
5618 if (strpos($type, ':')) {
5619 $uqType = substr($type, strrpos($type, ':') + 1);
5620 $ns = substr($type, 0, strrpos($type, ':'));
5621 $this->debug("in parametersMatchWrapped: got a prefixed type: $uqType, $ns");
5622 if ($this->getNamespaceFromPrefix($ns)) {
5623 $ns = $this->getNamespaceFromPrefix($ns);
5624 $this->debug("in parametersMatchWrapped: expanded prefixed type: $uqType, $ns");
5625 }
5626 } else {
5627 // TODO: should the type be compared to types in XSD, and the namespace
5628 // set to XSD if the type matches?
5629 $this->debug("in parametersMatchWrapped: No namespace for type $type");
5630 $ns = '';
5631 $uqType = $type;
5632 }
5633
5634 // get the type information
5635 if (!$typeDef = $this->getTypeDef($uqType, $ns)) {
5636 $this->debug("in parametersMatchWrapped: $type ($uqType) is not a supported type.");
5637 return false;
5638 }
5639 $this->debug("in parametersMatchWrapped: found typeDef=");
5640 $this->appendDebug($this->varDump($typeDef));
5641 if (substr($uqType, -1) == '^') {
5642 $uqType = substr($uqType, 0, -1);
5643 }
5644 $phpType = $typeDef['phpType'];
5645 $arrayType = (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '');
5646 $this->debug("in parametersMatchWrapped: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: $arrayType");
5647
5648 // we expect a complexType or element of complexType
5649 if ($phpType != 'struct') {
5650 $this->debug("in parametersMatchWrapped: not a struct");
5651 return false;
5652 }
5653
5654 // see whether the parameter names match the elements
5655 if (isset($typeDef['elements']) && is_array($typeDef['elements'])) {
5656 $elements = 0;
5657 $matches = 0;
5658 $change = false;
5659 if ($this->isArraySimpleOrStruct($parameters) == 'arraySimple' && count($parameters) == count($typeDef['elements'])) {
5660 $this->debug("in parametersMatchWrapped: (wrapped return value kludge) correct number of elements in simple array, so change array and wrap");
5661 $change = true;
5662 }
5663 foreach ($typeDef['elements'] as $name => $attrs) {
5664 if ($change) {
5665 $this->debug("in parametersMatchWrapped: change parameter $element to name $name");
5666 $parameters[$name] = $parameters[$elements];
5667 unset($parameters[$elements]);
5668 $matches++;
5669 } elseif (isset($parameters[$name])) {
5670 $this->debug("in parametersMatchWrapped: have parameter named $name");
5671 $matches++;
5672 } else {
5673 $this->debug("in parametersMatchWrapped: do not have parameter named $name");
5674 }
5675 $elements++;
5676 }
5677
5678 $this->debug("in parametersMatchWrapped: $matches parameter names match $elements wrapped parameter names");
5679 if ($matches == 0) {
5680 return false;
5681 }
5682 return true;
5683 }
5684
5685 // since there are no elements for the type, if the user passed no
5686 // parameters, the parameters match wrapped.
5687 $this->debug("in parametersMatchWrapped: no elements type $ns:$uqType");
5688 return count($parameters) == 0;
5689 }
isArraySimpleOrStruct($val)
detect if array is a simple array or a struct (associative array)
Definition: nusoap.php:365

References nusoap_base\appendDebug(), nusoap_base\debug(), nusoap_base\getNamespaceFromPrefix(), getTypeDef(), nusoap_base\isArraySimpleOrStruct(), and nusoap_base\varDump().

Referenced by serializeRPCParameters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseWSDL()

wsdl::parseWSDL (   $wsdl = '')

parses the wsdl document

Parameters
string$wsdlpath or URL @access private

Definition at line 4770 of file nusoap.php.

4771 {
4772 $this->debug("parse WSDL at path=$wsdl");
4773
4774 if ($wsdl == '') {
4775 $this->debug('no wsdl passed to parseWSDL()!!');
4776 $this->setError('no wsdl passed to parseWSDL()!!');
4777 return false;
4778 }
4779
4780 // parse $wsdl for url format
4781 $wsdl_props = parse_url($wsdl);
4782
4783 if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'http' || $wsdl_props['scheme'] == 'https')) {
4784 $this->debug('getting WSDL http(s) URL ' . $wsdl);
4785 // get wsdl
4786 $tr = new soap_transport_http($wsdl, $this->curl_options, $this->use_curl);
4787 $tr->request_method = 'GET';
4788 $tr->useSOAPAction = false;
4789 if ($this->proxyhost && $this->proxyport) {
4790 $tr->setProxy($this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword);
4791 }
4792 if ($this->authtype != '') {
4793 $tr->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
4794 }
4795 $tr->setEncoding('gzip, deflate');
4796 $wsdl_string = $tr->send('', $this->timeout, $this->response_timeout);
4797 //$this->debug("WSDL request\n" . $tr->outgoing_payload);
4798 //$this->debug("WSDL response\n" . $tr->incoming_payload);
4799 $this->appendDebug($tr->getDebug());
4800 // catch errors
4801 if ($err = $tr->getError()) {
4802 $errstr = 'HTTP ERROR: ' . $err;
4803 $this->debug($errstr);
4804 $this->setError($errstr);
4805 unset($tr);
4806 return false;
4807 }
4808 unset($tr);
4809 $this->debug("got WSDL URL");
4810 } else {
4811 // $wsdl is not http(s), so treat it as a file URL or plain file path
4812 if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'file') && isset($wsdl_props['path'])) {
4813 $path = isset($wsdl_props['host']) ? ($wsdl_props['host'] . ':' . $wsdl_props['path']) : $wsdl_props['path'];
4814 } else {
4815 $path = $wsdl;
4816 }
4817 $this->debug('getting WSDL file ' . $path);
4818 if ($fp = @fopen($path, 'r')) {
4819 $wsdl_string = '';
4820 while ($data = fread($fp, 32768)) {
4821 $wsdl_string .= $data;
4822 }
4823 fclose($fp);
4824 } else {
4825 $errstr = "Bad path to WSDL file $path";
4826 $this->debug($errstr);
4827 $this->setError($errstr);
4828 return false;
4829 }
4830 }
4831 $this->debug('Parse WSDL');
4832 // end new code added
4833 // Create an XML parser.
4834 $this->parser = xml_parser_create();
4835 // Set the options for parsing the XML data.
4836 // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
4837 xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
4838 // Set the object for the parser.
4839 // Set the element handlers for the parser.
4840 xml_set_element_handler($this->parser, $this->start_element(...), $this->end_element(...));
4841 xml_set_character_data_handler($this->parser, $this->character_data(...));
4842 // Parse the XML file.
4843 if (!xml_parse($this->parser, $wsdl_string, true)) {
4844 // Display an error message.
4845 $errstr = sprintf(
4846 'XML error parsing WSDL from %s on line %d: %s',
4847 $wsdl,
4848 xml_get_current_line_number($this->parser),
4849 xml_error_string(xml_get_error_code($this->parser))
4850 );
4851 $this->debug($errstr);
4852 $this->debug("XML payload:\n" . $wsdl_string);
4853 $this->setError($errstr);
4854 return false;
4855 }
4856 // free the parser
4857 xml_parser_free($this->parser);
4858 $this->debug('Parsing WSDL done');
4859 // catch wsdl parse errors
4860 if ($this->getError()) {
4861 return false;
4862 }
4863 return true;
4864 }
setError($str)
sets error string
Definition: nusoap.php:353
getError()
returns error string if present
Definition: nusoap.php:339
transport class for sending/receiving data via HTTP and HTTPS NOTE: PHP must be compiled with the CUR...
Definition: nusoap.php:2141
character_data($parser, $data)
element content handler
Definition: nusoap.php:5118
start_element($parser, $name, $attrs)
start-element handler
Definition: nusoap.php:4874
end_element($parser, $name)
end-element handler
Definition: nusoap.php:5087
$path
Definition: ltiservices.php:30

References $data, $path, $wsdl, nusoap_base\appendDebug(), character_data(), nusoap_base\debug(), end_element(), nusoap_base\getError(), nusoap_base\setError(), and start_element().

Referenced by fetchWSDL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

wsdl::serialize (   $debug = 0)

serialize the parsed wsdl

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

Definition at line 5464 of file nusoap.php.

5465 {
5466 $xml = '<?xml version="1.0" encoding="ISO-8859-1"?>';
5467 $xml .= "\n<definitions";
5468 foreach ($this->namespaces as $k => $v) {
5469 $xml .= " xmlns:$k=\"$v\"";
5470 }
5471 // 10.9.02 - add poulter fix for wsdl and tns declarations
5472 if (isset($this->namespaces['wsdl'])) {
5473 $xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\"";
5474 }
5475 if (isset($this->namespaces['tns'])) {
5476 $xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\"";
5477 }
5478 $xml .= '>';
5479 // imports
5480 if (sizeof($this->import) > 0) {
5481 foreach ($this->import as $ns => $list) {
5482 foreach ($list as $ii) {
5483 if ($ii['location'] != '') {
5484 $xml .= '<import location="' . $ii['location'] . '" namespace="' . $ns . '" />';
5485 } else {
5486 $xml .= '<import namespace="' . $ns . '" />';
5487 }
5488 }
5489 }
5490 }
5491 // types
5492 if (count($this->schemas) >= 1) {
5493 $xml .= "\n<types>\n";
5494 foreach ($this->schemas as $ns => $list) {
5495 foreach ($list as $xs) {
5496 $xml .= $xs->serializeSchema();
5497 }
5498 }
5499 $xml .= '</types>';
5500 }
5501 // messages
5502 if (count($this->messages) >= 1) {
5503 foreach ($this->messages as $msgName => $msgParts) {
5504 $xml .= "\n<message name=\"" . $msgName . '">';
5505 if (is_array($msgParts)) {
5506 foreach ($msgParts as $partName => $partType) {
5507 // print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'<br>';
5508 if (strpos($partType, ':')) {
5509 $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType));
5510 } elseif (isset($this->typemap[$this->namespaces['xsd']][$partType])) {
5511 // print 'checking typemap: '.$this->XMLSchemaVersion.'<br>';
5512 $typePrefix = 'xsd';
5513 } else {
5514 foreach ($this->typemap as $ns => $types) {
5515 if (isset($types[$partType])) {
5516 $typePrefix = $this->getPrefixFromNamespace($ns);
5517 }
5518 }
5519 if (!isset($typePrefix)) {
5520 die("$partType has no namespace!");
5521 }
5522 }
5523 $ns = $this->getNamespaceFromPrefix($typePrefix);
5524 $localPart = $this->getLocalPart($partType);
5525 $typeDef = $this->getTypeDef($localPart, $ns);
5526 if (($typeDef['typeClass'] ?? '') == 'element') {
5527 $elementortype = 'element';
5528 if (substr($localPart, -1) == '^') {
5529 $localPart = substr($localPart, 0, -1);
5530 }
5531 } else {
5532 $elementortype = 'type';
5533 }
5534 $xml .= "\n" . ' <part name="' . $partName . '" ' . $elementortype . '="' . $typePrefix . ':' . $localPart . '" />';
5535 }
5536 }
5537 $xml .= '</message>';
5538 }
5539 }
5540 // bindings & porttypes
5541 if (count($this->bindings) >= 1) {
5542 $binding_xml = '';
5543 $portType_xml = '';
5544 foreach ($this->bindings as $bindingName => $attrs) {
5545 $binding_xml .= "\n<binding name=\"" . $bindingName . '" type="tns:' . $attrs['portType'] . '">';
5546 $binding_xml .= "\n" . ' <soap:binding style="' . $attrs['style'] . '" transport="' . $attrs['transport'] . '"/>';
5547 $portType_xml .= "\n<portType name=\"" . $attrs['portType'] . '">';
5548 foreach ($attrs['operations'] as $opName => $opParts) {
5549 $binding_xml .= "\n" . ' <operation name="' . $opName . '">';
5550 $binding_xml .= "\n" . ' <soap:operation soapAction="' . $opParts['soapAction'] . '" style="' . $opParts['style'] . '"/>';
5551 if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') {
5552 $enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
5553 } else {
5554 $enc_style = '';
5555 }
5556 $binding_xml .= "\n" . ' <input><soap:body use="' . $opParts['input']['use'] . '" namespace="' . $opParts['input']['namespace'] . '"' . $enc_style . '/></input>';
5557 if (isset($opParts['output']['encodingStyle']) && $opParts['output']['encodingStyle'] != '') {
5558 $enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"';
5559 } else {
5560 $enc_style = '';
5561 }
5562 $binding_xml .= "\n" . ' <output><soap:body use="' . $opParts['output']['use'] . '" namespace="' . $opParts['output']['namespace'] . '"' . $enc_style . '/></output>';
5563 $binding_xml .= "\n" . ' </operation>';
5564 $portType_xml .= "\n" . ' <operation name="' . $opParts['name'] . '"';
5565 if (isset($opParts['parameterOrder'])) {
5566 $portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"';
5567 }
5568 $portType_xml .= '>';
5569 if (isset($opParts['documentation']) && $opParts['documentation'] != '') {
5570 $portType_xml .= "\n" . ' <documentation>' . htmlspecialchars($opParts['documentation']) . '</documentation>';
5571 }
5572 $portType_xml .= "\n" . ' <input message="tns:' . $opParts['input']['message'] . '"/>';
5573 $portType_xml .= "\n" . ' <output message="tns:' . $opParts['output']['message'] . '"/>';
5574 $portType_xml .= "\n" . ' </operation>';
5575 }
5576 $portType_xml .= "\n" . '</portType>';
5577 $binding_xml .= "\n" . '</binding>';
5578 }
5579 $xml .= $portType_xml . $binding_xml;
5580 }
5581 // services
5582 $xml .= "\n<service name=\"" . $this->serviceName . '">';
5583 $has_client = isset($_GET['client_id']);
5584 if (count($this->ports) >= 1) {
5585 foreach ($this->ports as $pName => $attrs) {
5586 $xml .= "\n" . ' <port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">';
5587 $locations = $attrs['location'];
5588 $locations = is_array($locations) ? $locations : [$locations];
5589 foreach ($locations as $location) {
5590 $address = $location . ($debug || $has_client ? "?" : "")
5591 . ($debug ? 'debug=1' : '') . ($debug && $has_client ? "&amp;" : "")
5592 . ($has_client ? 'client_id=' . $_GET['client_id'] : '');
5593 $xml .= "\n" . ' <soap:address location="' . $address . '"/>';
5594 }
5595 $xml .= "\n" . ' </port>';
5596 }
5597 }
5598
5599 $xml .= "\n" . '</service>';
5600 return $xml . "\n</definitions>";
5601 }
$location
Definition: buildRTE.php:22
getPrefixFromNamespace($ns)
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given...
Definition: nusoap.php:830
$_GET['cmd']
Definition: lti.php:26

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

Referenced by nusoap_server\service().

+ Here is the call graph for this function:
+ Here is the caller 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 @access private

Definition at line 6183 of file nusoap.php.

6184 {
6185 $xml = '';
6186 if (isset($typeDef['attrs']) && is_array($typeDef['attrs'])) {
6187 $this->debug("serialize attributes for XML Schema type $ns:$uqType");
6188 if (is_array($value)) {
6189 $xvalue = $value;
6190 } elseif (is_object($value)) {
6191 $xvalue = get_object_vars($value);
6192 } else {
6193 $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
6194 $xvalue = array();
6195 }
6196 foreach ($typeDef['attrs'] as $aName => $attrs) {
6197 if (isset($xvalue['!' . $aName])) {
6198 $xname = '!' . $aName;
6199 $this->debug("value provided for attribute $aName with key $xname");
6200 } elseif (isset($xvalue[$aName])) {
6201 $xname = $aName;
6202 $this->debug("value provided for attribute $aName with key $xname");
6203 } elseif (isset($attrs['default'])) {
6204 $xname = '!' . $aName;
6205 $xvalue[$xname] = $attrs['default'];
6206 $this->debug('use default value of ' . $xvalue[$aName] . ' for attribute ' . $aName);
6207 } else {
6208 $xname = '';
6209 $this->debug("no value provided for attribute $aName");
6210 }
6211 if ($xname) {
6212 $xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\"";
6213 }
6214 }
6215 } else {
6216 $this->debug("no attributes to serialize for XML Schema type $ns:$uqType");
6217 }
6218 if (isset($typeDef['extensionBase'])) {
6219 $ns = $this->getPrefix($typeDef['extensionBase']);
6220 $uqType = $this->getLocalPart($typeDef['extensionBase']);
6221 if ($this->getNamespaceFromPrefix($ns)) {
6222 $ns = $this->getNamespaceFromPrefix($ns);
6223 }
6224 if ($typeDef = $this->getTypeDef($uqType, $ns)) {
6225 $this->debug("serialize attributes for extension base $ns:$uqType");
6226 $xml .= $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
6227 } else {
6228 $this->debug("extension base $ns:$uqType is not a supported type");
6229 }
6230 }
6231 return $xml;
6232 }
expandEntities($val)
expands entities, e.g.
Definition: nusoap.php:321
serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType)
serializes the attributes for a complexType
Definition: nusoap.php:6183

References nusoap_base\debug(), nusoap_base\expandEntities(), nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), nusoap_base\getPrefix(), getTypeDef(), and serializeComplexTypeAttributes().

Referenced by serializeComplexTypeAttributes(), and serializeType().

+ Here is the call graph for this function:
+ Here is the caller 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 @access private

Definition at line 6246 of file nusoap.php.

6247 {
6248 $xml = '';
6249 if (isset($typeDef['elements']) && is_array($typeDef['elements'])) {
6250 $this->debug("in serializeComplexTypeElements, serialize elements for XML Schema type $ns:$uqType");
6251 if (is_array($value)) {
6252 $xvalue = $value;
6253 } elseif (is_object($value)) {
6254 $xvalue = get_object_vars($value);
6255 } else {
6256 $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
6257 $xvalue = array();
6258 }
6259 // toggle whether all elements are present - ideally should validate against schema
6260 if (count($typeDef['elements']) != count($xvalue)) {
6261 $optionals = true;
6262 }
6263 foreach ($typeDef['elements'] as $eName => $attrs) {
6264 if (!isset($xvalue[$eName])) {
6265 if (isset($attrs['default'])) {
6266 $xvalue[$eName] = $attrs['default'];
6267 $this->debug('use default value of ' . $xvalue[$eName] . ' for element ' . $eName);
6268 }
6269 }
6270 // if user took advantage of a minOccurs=0, then only serialize named parameters
6271 if (isset($optionals)
6272 && (!isset($xvalue[$eName]))
6273 && ((!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
6274 ) {
6275 if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') {
6276 $this->debug("apparent error: no value provided for element $eName with minOccurs=" . $attrs['minOccurs']);
6277 }
6278 // do nothing
6279 $this->debug("no value provided for complexType element $eName and element is not nillable, so serialize nothing");
6280 } else {
6281 // get value
6282 if (isset($xvalue[$eName])) {
6283 $v = $xvalue[$eName];
6284 } else {
6285 $v = null;
6286 }
6287 if (isset($attrs['form'])) {
6288 $unqualified = ($attrs['form'] == 'unqualified');
6289 } else {
6290 $unqualified = false;
6291 }
6292 if (isset($attrs['maxOccurs']) && ($attrs['maxOccurs'] == 'unbounded' || $attrs['maxOccurs'] > 1) && isset($v) && is_array($v) && $this->isArraySimpleOrStruct($v) == 'arraySimple') {
6293 $vv = $v;
6294 foreach ($vv as $k => $v) {
6295 if (isset($attrs['type']) || isset($attrs['ref'])) {
6296 // serialize schema-defined type
6297 $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
6298 } else {
6299 // serialize generic type (can this ever really happen?)
6300 $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
6301 $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
6302 }
6303 }
6304 } else {
6305 if (isset($attrs['type']) || isset($attrs['ref'])) {
6306 // serialize schema-defined type
6307 $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
6308 } else {
6309 // serialize generic type (can this ever really happen?)
6310 $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
6311 $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
6312 }
6313 }
6314 }
6315 }
6316 } else {
6317 $this->debug("no elements to serialize for XML Schema type $ns:$uqType");
6318 }
6319 if (isset($typeDef['extensionBase'])) {
6320 $ns = $this->getPrefix($typeDef['extensionBase']);
6321 $uqType = $this->getLocalPart($typeDef['extensionBase']);
6322 if ($this->getNamespaceFromPrefix($ns)) {
6323 $ns = $this->getNamespaceFromPrefix($ns);
6324 }
6325 if ($typeDef = $this->getTypeDef($uqType, $ns)) {
6326 $this->debug("serialize elements for extension base $ns:$uqType");
6327 $xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle);
6328 } else {
6329 $this->debug("extension base $ns:$uqType is not a supported type");
6330 }
6331 }
6332 return $xml;
6333 }
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.
Definition: nusoap.php:391
serializeType($name, $type, $value, $use='encoded', $encodingStyle=false, $unqualified=false)
serializes a PHP value according a given type definition
Definition: nusoap.php:5879
serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false)
serializes the elements for a complexType
Definition: nusoap.php:6246

References nusoap_base\debug(), nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), nusoap_base\getPrefix(), getTypeDef(), nusoap_base\isArraySimpleOrStruct(), nusoap_base\serialize_val(), serializeComplexTypeElements(), and serializeType().

Referenced by serializeComplexTypeElements(), and serializeType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serializeParameters()

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) @access public
Deprecated:

Definition at line 5801 of file nusoap.php.

5802 {
5803 $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion");
5804 $this->appendDebug('parameters=' . $this->varDump($parameters));
5805
5806 if ($direction != 'input' && $direction != 'output') {
5807 $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
5808 $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
5809 return false;
5810 }
5811 if (!$opData = $this->getOperationData($operation)) {
5812 $this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
5813 $this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
5814 return false;
5815 }
5816 $this->debug('opData:');
5817 $this->appendDebug($this->varDump($opData));
5818
5819 // Get encoding style for output and set to current
5820 $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
5821 if (($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
5822 $encodingStyle = $opData['output']['encodingStyle'];
5823 $enc_style = $encodingStyle;
5824 }
5825
5826 // set input params
5827 $xml = '';
5828 if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
5829 $use = $opData[$direction]['use'];
5830 $this->debug("use=$use");
5831 $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
5832 if (is_array($parameters)) {
5833 $parametersArrayType = $this->isArraySimpleOrStruct($parameters);
5834 $this->debug('have ' . $parametersArrayType . ' parameters');
5835 foreach ($opData[$direction]['parts'] as $name => $type) {
5836 $this->debug('serializing part "' . $name . '" of type "' . $type . '"');
5837 // Track encoding style
5838 if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
5839 $encodingStyle = $opData[$direction]['encodingStyle'];
5840 $enc_style = $encodingStyle;
5841 } else {
5842 $enc_style = false;
5843 }
5844 // NOTE: add error handling here
5845 // if serializeType returns false, then catch global error and fault
5846 if ($parametersArrayType == 'arraySimple') {
5847 $p = array_shift($parameters);
5848 $this->debug('calling serializeType w/indexed param');
5849 $xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
5850 } elseif (isset($parameters[$name])) {
5851 $this->debug('calling serializeType w/named param');
5852 $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
5853 } else {
5854 // TODO: only send nillable
5855 $this->debug('calling serializeType w/null param');
5856 $xml .= $this->serializeType($name, $type, null, $use, $enc_style);
5857 }
5858 }
5859 } else {
5860 $this->debug('no parameters passed.');
5861 }
5862 }
5863 $this->debug("serializeParameters returning: $xml");
5864 return $xml;
5865 }
getOperationData($operation, $bindingType='soap')
returns an associative array of data necessary for calling an operation
Definition: nusoap.php:5194

References $opData, nusoap_base\appendDebug(), nusoap_base\debug(), getOperationData(), nusoap_base\isArraySimpleOrStruct(), serializeType(), nusoap_base\setError(), and nusoap_base\varDump().

+ Here is the call graph for this function:

◆ serializeRPCParameters()

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) @access public

Definition at line 5706 of file nusoap.php.

5707 {
5708 $this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType");
5709 $this->appendDebug('parameters=' . $this->varDump($parameters));
5710
5711 if ($direction != 'input' && $direction != 'output') {
5712 $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
5713 $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
5714 return false;
5715 }
5716 if (!$opData = $this->getOperationData($operation, $bindingType)) {
5717 $this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
5718 $this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
5719 return false;
5720 }
5721 $this->debug('in serializeRPCParameters: opData:');
5722 $this->appendDebug($this->varDump($opData));
5723
5724 // Get encoding style for output and set to current
5725 $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
5726 if (($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
5727 $encodingStyle = $opData['output']['encodingStyle'];
5728 $enc_style = $encodingStyle;
5729 }
5730
5731 // set input params
5732 $xml = '';
5733 if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
5734 $parts = &$opData[$direction]['parts'];
5735 $part_count = sizeof($parts);
5736 $style = $opData['style'];
5737 $use = $opData[$direction]['use'];
5738 $this->debug("have $part_count part(s) to serialize using $style/$use");
5739 if (is_array($parameters)) {
5740 $parametersArrayType = $this->isArraySimpleOrStruct($parameters);
5741 $parameter_count = count($parameters);
5742 $this->debug("have $parameter_count parameter(s) provided as $parametersArrayType to serialize");
5743 // check for Microsoft-style wrapped parameters
5744 if ($style == 'document' && $use == 'literal' && $part_count == 1 && isset($parts['parameters'])) {
5745 $this->debug('check whether the caller has wrapped the parameters');
5746 if ((($parametersArrayType == 'arrayStruct' || $parameter_count == 0) && !isset($parameters['parameters'])) || ($direction == 'output' && $parametersArrayType == 'arraySimple' && $parameter_count == 1)) {
5747 $this->debug('check whether caller\'s parameters match the wrapped ones');
5748 if ($this->parametersMatchWrapped($parts['parameters'], $parameters)) {
5749 $this->debug('wrap the parameters for the caller');
5750 $parameters = array('parameters' => $parameters);
5751 $parameter_count = 1;
5752 }
5753 }
5754 }
5755 foreach ($parts as $name => $type) {
5756 $this->debug("serializing part $name of type $type");
5757 // Track encoding style
5758 if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
5759 $encodingStyle = $opData[$direction]['encodingStyle'];
5760 $enc_style = $encodingStyle;
5761 } else {
5762 $enc_style = false;
5763 }
5764 // NOTE: add error handling here
5765 // if serializeType returns false, then catch global error and fault
5766 if ($parametersArrayType == 'arraySimple') {
5767 $p = array_shift($parameters);
5768 $this->debug('calling serializeType w/indexed param');
5769 $xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
5770 } elseif (isset($parameters[$name])) {
5771 $this->debug('calling serializeType w/named param');
5772 $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
5773 } else {
5774 // TODO: only send nillable
5775 $this->debug('calling serializeType w/null param');
5776 $xml .= $this->serializeType($name, $type, null, $use, $enc_style);
5777 }
5778 }
5779 } else {
5780 $this->debug('no parameters passed.');
5781 }
5782 }
5783 $this->debug("serializeRPCParameters returning: $xml");
5784 return $xml;
5785 }
parametersMatchWrapped($type, &$parameters)
determine whether a set of parameters are unwrapped when they are expect to be wrapped,...
Definition: nusoap.php:5612
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61

References $opData, $parts, nusoap_base\appendDebug(), nusoap_base\debug(), getOperationData(), nusoap_base\isArraySimpleOrStruct(), parametersMatchWrapped(), serializeType(), nusoap_base\setError(), and nusoap_base\varDump().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serializeType()

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 @access private

Definition at line 5879 of file nusoap.php.

5880 {
5881 $this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified"));
5882 $this->appendDebug("value=" . $this->varDump($value));
5883 if ($use == 'encoded' && $encodingStyle) {
5884 $encodingStyle = ' SOAP-ENV:encodingStyle="' . $encodingStyle . '"';
5885 }
5886
5887 // if a soapval has been supplied, let its type override the WSDL
5888 if (is_object($value) && get_class($value) == 'soapval') {
5889 if ($value->type_ns) {
5890 $type = $value->type_ns . ':' . $value->type;
5891 $forceType = true;
5892 $this->debug("in serializeType: soapval overrides type to $type");
5893 } elseif ($value->type) {
5894 $type = $value->type;
5895 $forceType = true;
5896 $this->debug("in serializeType: soapval overrides type to $type");
5897 } else {
5898 $forceType = false;
5899 $this->debug("in serializeType: soapval does not override type");
5900 }
5901 $attrs = $value->attributes;
5902 $value = $value->value;
5903 $this->debug("in serializeType: soapval overrides value to $value");
5904 if ($attrs) {
5905 if (!is_array($value)) {
5906 $value['!'] = $value;
5907 }
5908 foreach ($attrs as $n => $v) {
5909 $value['!' . $n] = $v;
5910 }
5911 $this->debug("in serializeType: soapval provides attributes");
5912 }
5913 } else {
5914 $forceType = false;
5915 }
5916
5917 $xml = '';
5918 if (strpos($type, ':')) {
5919 $uqType = substr($type, strrpos($type, ':') + 1);
5920 $ns = substr($type, 0, strrpos($type, ':'));
5921 $this->debug("in serializeType: got a prefixed type: $uqType, $ns");
5922 if ($this->getNamespaceFromPrefix($ns)) {
5923 $ns = $this->getNamespaceFromPrefix($ns);
5924 $this->debug("in serializeType: expanded prefixed type: $uqType, $ns");
5925 }
5926
5927 if ($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/') {
5928 $this->debug('in serializeType: type namespace indicates XML Schema or SOAP Encoding type');
5929 if ($unqualified && $use == 'literal') {
5930 $elementNS = " xmlns=\"\"";
5931 } else {
5932 $elementNS = '';
5933 }
5934 if (is_null($value)) {
5935 if ($use == 'literal') {
5936 // TODO: depends on minOccurs
5937 $xml = "<$name$elementNS/>";
5938 } else {
5939 // TODO: depends on nillable, which should be checked before calling this method
5940 $xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
5941 }
5942 $this->debug("in serializeType: returning: $xml");
5943 return $xml;
5944 }
5945 if ($uqType == 'Array') {
5946 // JBoss/Axis does this sometimes
5947 return $this->serialize_val($value, $name, false, false, false, false, $use);
5948 }
5949 if ($uqType == 'boolean') {
5950 if ((is_string($value) && $value == 'false') || (! $value)) {
5951 $value = 'false';
5952 } else {
5953 $value = 'true';
5954 }
5955 }
5956 if ($uqType == 'string' && gettype($value) == 'string') {
5957 $value = $this->expandEntities($value);
5958 }
5959 if (($uqType == 'long' || $uqType == 'unsignedLong') && gettype($value) == 'double') {
5960 $value = sprintf("%.0lf", $value);
5961 }
5962 // it's a scalar
5963 // TODO: what about null/nil values?
5964 // check type isn't a custom type extending xmlschema namespace
5965 if (!$this->getTypeDef($uqType, $ns)) {
5966 if ($use == 'literal') {
5967 if ($forceType) {
5968 $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
5969 } else {
5970 $xml = "<$name$elementNS>$value</$name>";
5971 }
5972 } else {
5973 $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
5974 }
5975 $this->debug("in serializeType: returning: $xml");
5976 return $xml;
5977 }
5978 $this->debug('custom type extends XML Schema or SOAP Encoding namespace (yuck)');
5979 } elseif ($ns == 'http://xml.apache.org/xml-soap') {
5980 $this->debug('in serializeType: appears to be Apache SOAP type');
5981 if ($uqType == 'Map') {
5982 $tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
5983 if (! $tt_prefix) {
5984 $this->debug('in serializeType: Add namespace for Apache SOAP type');
5985 $tt_prefix = 'ns' . rand(1000, 9999);
5986 $this->namespaces[$tt_prefix] = 'http://xml.apache.org/xml-soap';
5987 // force this to be added to usedNamespaces
5988 $tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
5989 }
5990 $contents = '';
5991 foreach ($value as $k => $v) {
5992 $this->debug("serializing map element: key $k, value $v");
5993 $contents .= '<item>';
5994 $contents .= $this->serialize_val($k, 'key', false, false, false, false, $use);
5995 $contents .= $this->serialize_val($v, 'value', false, false, false, false, $use);
5996 $contents .= '</item>';
5997 }
5998 if ($use == 'literal') {
5999 if ($forceType) {
6000 $xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\">$contents</$name>";
6001 } else {
6002 $xml = "<$name>$contents</$name>";
6003 }
6004 } else {
6005 $xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\"$encodingStyle>$contents</$name>";
6006 }
6007 $this->debug("in serializeType: returning: $xml");
6008 return $xml;
6009 }
6010 $this->debug('in serializeType: Apache SOAP type, but only support Map');
6011 }
6012 } else {
6013 // TODO: should the type be compared to types in XSD, and the namespace
6014 // set to XSD if the type matches?
6015 $this->debug("in serializeType: No namespace for type $type");
6016 $ns = '';
6017 $uqType = $type;
6018 }
6019 if (!$typeDef = $this->getTypeDef($uqType, $ns)) {
6020 $this->setError("$type ($uqType) is not a supported type.");
6021 $this->debug("in serializeType: $type ($uqType) is not a supported type.");
6022 return false;
6023 } else {
6024 $this->debug("in serializeType: found typeDef");
6025 $this->appendDebug('typeDef=' . $this->varDump($typeDef));
6026 if (substr($uqType, -1) == '^') {
6027 $uqType = substr($uqType, 0, -1);
6028 }
6029 }
6030 $phpType = $typeDef['phpType'];
6031 $this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : ''));
6032 // if php type == struct, map value to the <all> element names
6033 if ($phpType == 'struct') {
6034 if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') {
6035 $elementName = $uqType;
6036 if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
6037 $elementNS = " xmlns=\"$ns\"";
6038 } else {
6039 $elementNS = " xmlns=\"\"";
6040 }
6041 } else {
6042 $elementName = $name;
6043 if ($unqualified) {
6044 $elementNS = " xmlns=\"\"";
6045 } else {
6046 $elementNS = '';
6047 }
6048 }
6049 if (is_null($value)) {
6050 if ($use == 'literal') {
6051 // TODO: depends on minOccurs
6052 $xml = "<$elementName$elementNS/>";
6053 } else {
6054 $xml = "<$elementName$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
6055 }
6056 $this->debug("in serializeType: returning: $xml");
6057 return $xml;
6058 }
6059 if (is_object($value)) {
6060 $value = get_object_vars($value);
6061 }
6062 if (is_array($value)) {
6063 $elementAttrs = $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
6064 if ($use == 'literal') {
6065 if ($forceType) {
6066 $xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">";
6067 } else {
6068 $xml = "<$elementName$elementNS$elementAttrs>";
6069 }
6070 } else {
6071 $xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>";
6072 }
6073
6074 $xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle);
6075 $xml .= "</$elementName>";
6076 } else {
6077 $this->debug("in serializeType: phpType is struct, but value is not an array");
6078 $this->setError("phpType is struct, but value is not an array: see debug output for details");
6079 $xml = '';
6080 }
6081 } elseif ($phpType == 'array') {
6082 if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
6083 $elementNS = " xmlns=\"$ns\"";
6084 } else {
6085 if ($unqualified) {
6086 $elementNS = " xmlns=\"\"";
6087 } else {
6088 $elementNS = '';
6089 }
6090 }
6091 if (is_null($value)) {
6092 if ($use == 'literal') {
6093 // TODO: depends on minOccurs
6094 $xml = "<$name$elementNS/>";
6095 } else {
6096 $xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" .
6097 $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
6098 ":Array\" " .
6099 $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
6100 ':arrayType="' .
6101 $this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) .
6102 ':' .
6103 $this->getLocalPart($typeDef['arrayType']) . "[0]\"/>";
6104 }
6105 $this->debug("in serializeType: returning: $xml");
6106 return $xml;
6107 }
6108 if (isset($typeDef['multidimensional'])) {
6109 $nv = array();
6110 foreach ($value as $v) {
6111 $cols = ',' . sizeof($v);
6112 $nv = array_merge($nv, $v);
6113 }
6114 $value = $nv;
6115 } else {
6116 $cols = '';
6117 }
6118 if (is_array($value) && sizeof($value) >= 1) {
6119 $rows = sizeof($value);
6120 $contents = '';
6121 foreach ($value as $k => $v) {
6122 $this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]");
6123 //if (strpos($typeDef['arrayType'], ':') ) {
6124 if (!in_array($typeDef['arrayType'], $this->typemap['http://www.w3.org/2001/XMLSchema'])) {
6125 $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);
6126 } else {
6127 $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use);
6128 }
6129 }
6130 } else {
6131 $rows = 0;
6132 $contents = null;
6133 }
6134 // TODO: for now, an empty value will be serialized as a zero element
6135 // array. Revisit this when coding the handling of null/nil values.
6136 if ($use == 'literal') {
6137 $xml = "<$name$elementNS>"
6138 . $contents
6139 . "</$name>";
6140 } else {
6141 $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') . ':Array" ' .
6142 $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/')
6143 . ':arrayType="'
6144 . $this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType']))
6145 . ":" . $this->getLocalPart($typeDef['arrayType']) . "[$rows$cols]\">"
6146 . $contents
6147 . "</$name>";
6148 }
6149 } elseif ($phpType == 'scalar') {
6150 if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
6151 $elementNS = " xmlns=\"$ns\"";
6152 } else {
6153 if ($unqualified) {
6154 $elementNS = " xmlns=\"\"";
6155 } else {
6156 $elementNS = '';
6157 }
6158 }
6159 if ($use == 'literal') {
6160 if ($forceType) {
6161 $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
6162 } else {
6163 $xml = "<$name$elementNS>$value</$name>";
6164 }
6165 } else {
6166 $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
6167 }
6168 }
6169 $this->debug("in serializeType: returning: $xml");
6170 return $xml;
6171 }

References nusoap_base\appendDebug(), nusoap_base\debug(), nusoap_base\expandEntities(), nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), nusoap_base\getPrefix(), nusoap_base\getPrefixFromNamespace(), getTypeDef(), nusoap_base\serialize_val(), serializeComplexTypeAttributes(), serializeComplexTypeElements(), serializeType(), nusoap_base\setError(), and nusoap_base\varDump().

Referenced by serializeComplexTypeElements(), serializeParameters(), serializeRPCParameters(), and serializeType().

+ Here is the call graph for this function:
+ Here is the caller 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) @access public

Definition at line 5138 of file nusoap.php.

5139 {
5140 $this->debug("setCredentials username=$username authtype=$authtype certRequest=");
5141 $this->appendDebug($this->varDump($certRequest));
5142 $this->username = $username;
5143 $this->password = $password;
5144 $this->authtype = $authtype;
5145 $this->certRequest = $certRequest;
5146 }
$username
Definition: nusoap.php:4625
$certRequest
Definition: nusoap.php:4628
$password
Definition: nusoap.php:4626
$authtype
Definition: nusoap.php:4627

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

Referenced by nusoap_client\loadWSDL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start_element()

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

start-element handler

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

Definition at line 4874 of file nusoap.php.

4875 {
4876 if ($this->status == 'schema') {
4877 $this->currentSchema->schemaStartElement($parser, $name, $attrs);
4878 $this->appendDebug($this->currentSchema->getDebug());
4879 $this->currentSchema->clearDebug();
4880 } elseif (preg_match('/schema$/', $name)) {
4881 $this->debug('Parsing WSDL schema');
4882 // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
4883 $this->status = 'schema';
4884 $this->currentSchema = new nusoap_xmlschema('', '', $this->namespaces);
4885 $this->currentSchema->schemaStartElement($parser, $name, $attrs);
4886 $this->appendDebug($this->currentSchema->getDebug());
4887 $this->currentSchema->clearDebug();
4888 } else {
4889 // position in the total number of elements, starting from 0
4890 $pos = $this->position++;
4891 $depth = $this->depth++;
4892 // set self as current value for this depth
4893 $this->depth_array[$depth] = $pos;
4894 $this->message[$pos] = array('cdata' => '');
4895 // process attributes
4896 if (count($attrs) > 0) {
4897 // register namespace declarations
4898 foreach ($attrs as $k => $v) {
4899 if (preg_match('/^xmlns/', $k)) {
4900 if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
4901 $this->namespaces[$ns_prefix] = $v;
4902 } else {
4903 $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v;
4904 }
4905 if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') {
4906 $this->XMLSchemaVersion = $v;
4907 $this->namespaces['xsi'] = $v . '-instance';
4908 }
4909 }
4910 }
4911 // expand each attribute prefix to its namespace
4912 foreach ($attrs as $k => $v) {
4913 $k = strpos($k, ':') ? $this->expandQname($k) : $k;
4914 if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') {
4915 $v = strpos($v, ':') ? $this->expandQname($v) : $v;
4916 }
4917 $eAttrs[$k] = $v;
4918 }
4919 $attrs = $eAttrs;
4920 } else {
4921 $attrs = array();
4922 }
4923 // get element prefix, namespace and name
4924 if (preg_match('/:/', $name)) {
4925 // get ns prefix
4926 $prefix = substr($name, 0, strpos($name, ':'));
4927 // get ns
4928 $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : '';
4929 // get unqualified name
4930 $name = substr(strstr($name, ':'), 1);
4931 }
4932 // process attributes, expanding any prefixes to namespaces
4933 // find status, register data
4934 switch ($this->status) {
4935 case 'message':
4936 if ($name == 'part') {
4937 if (isset($attrs['type'])) {
4938 $this->debug("msg " . $this->currentMessage . ": found part (with type) $attrs[name]: " . implode(',', $attrs));
4939 $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type'];
4940 }
4941 if (isset($attrs['element'])) {
4942 $this->debug("msg " . $this->currentMessage . ": found part (with element) $attrs[name]: " . implode(',', $attrs));
4943 $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'] . '^';
4944 }
4945 }
4946 break;
4947 case 'portType':
4948 switch ($name) {
4949 case 'operation':
4950 $this->currentPortOperation = $attrs['name'];
4951 $this->debug("portType $this->currentPortType operation: $this->currentPortOperation");
4952 if (isset($attrs['parameterOrder'])) {
4953 $this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder'];
4954 }
4955 break;
4956 case 'documentation':
4957 $this->documentation = true;
4958 break;
4959 // merge input/output data
4960 default:
4961 $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : '';
4962 $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m;
4963 break;
4964 }
4965 break;
4966 case 'binding':
4967 switch ($name) {
4968 case 'binding':
4969 // get ns prefix
4970 if (isset($attrs['style'])) {
4971 $this->bindings[$this->currentBinding]['prefix'] = $prefix;
4972 }
4973 $this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs);
4974 break;
4975 case 'header':
4976 $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus]['headers'][] = $attrs;
4977 break;
4978 case 'operation':
4979 if (isset($attrs['soapAction'])) {
4980 $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction'];
4981 }
4982 if (isset($attrs['style'])) {
4983 $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style'];
4984 }
4985 if (isset($attrs['name'])) {
4986 $this->currentOperation = $attrs['name'];
4987 $this->debug("current binding operation: $this->currentOperation");
4988 $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name'];
4989 $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding;
4990 $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : '';
4991 }
4992 break;
4993 case 'input':
4994 $this->opStatus = 'input';
4995 break;
4996 case 'output':
4997 $this->opStatus = 'output';
4998 break;
4999 case 'body':
5000 if (isset($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus])) {
5001 $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs);
5002 } else {
5003 $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs;
5004 }
5005 break;
5006 }
5007 break;
5008 case 'service':
5009 switch ($name) {
5010 case 'port':
5011 $this->currentPort = $attrs['name'];
5012 $this->debug('current port: ' . $this->currentPort);
5013 $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']);
5014
5015 break;
5016 case 'address':
5017 $this->ports[$this->currentPort]['location'] = $attrs['location'];
5018 $this->ports[$this->currentPort]['bindingType'] = $namespace;
5019 $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace;
5020 $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location'];
5021 break;
5022 }
5023 break;
5024 }
5025 // set status
5026 switch ($name) {
5027 case 'import':
5028 if (isset($attrs['location'])) {
5029 $this->import[$attrs['namespace']][] = array('location' => $attrs['location'], 'loaded' => false);
5030 $this->debug('parsing import ' . $attrs['namespace'] . ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]) . ')');
5031 } else {
5032 $this->import[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
5033 if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
5034 $this->namespaces['ns' . (count($this->namespaces) + 1)] = $attrs['namespace'];
5035 }
5036 $this->debug('parsing import ' . $attrs['namespace'] . ' - [no location] (' . count($this->import[$attrs['namespace']]) . ')');
5037 }
5038 break;
5039 //wait for schema
5040 //case 'types':
5041 // $this->status = 'schema';
5042 // break;
5043 case 'message':
5044 $this->status = 'message';
5045 $this->messages[$attrs['name']] = array();
5046 $this->currentMessage = $attrs['name'];
5047 break;
5048 case 'portType':
5049 $this->status = 'portType';
5050 $this->portTypes[$attrs['name']] = array();
5051 $this->currentPortType = $attrs['name'];
5052 break;
5053 case "binding":
5054 if (isset($attrs['name'])) {
5055 // get binding name
5056 if (strpos($attrs['name'], ':')) {
5057 $this->currentBinding = $this->getLocalPart($attrs['name']);
5058 } else {
5059 $this->currentBinding = $attrs['name'];
5060 }
5061 $this->status = 'binding';
5062 $this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']);
5063 $this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']);
5064 }
5065 break;
5066 case 'service':
5067 $this->serviceName = $attrs['name'];
5068 $this->status = 'service';
5069 $this->debug('current service: ' . $this->serviceName);
5070 break;
5071 case 'definitions':
5072 foreach ($attrs as $name => $value) {
5073 $this->wsdl_info[$name] = $value;
5074 }
5075 break;
5076 }
5077 }
5078 }
parses an XML Schema, allows access to it's data, other utility methods.
Definition: nusoap.php:1086
$currentMessage
Definition: nusoap.php:4596
$currentPortType
Definition: nusoap.php:4599
$currentPortOperation
Definition: nusoap.php:4588
$currentOperation
Definition: nusoap.php:4597
$currentPort
Definition: nusoap.php:4603
$currentBinding
Definition: nusoap.php:4601
$opStatus
Definition: nusoap.php:4587

References $currentBinding, $currentMessage, $currentOperation, $currentPort, $currentPortOperation, $currentPortType, $depth, $namespace, $opStatus, $parser, nusoap_base\appendDebug(), nusoap_base\debug(), nusoap_base\expandQname(), nusoap_base\getLocalPart(), and nusoap_base\getPrefixFromNamespace().

Referenced by parseWSDL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webDescription()

wsdl::webDescription ( )

prints html description of services

@access private

Definition at line 5322 of file nusoap.php.

5323 {
5324 global $HTTP_SERVER_VARS;
5325
5326 if (isset($_SERVER)) {
5327 $PHP_SELF = $_SERVER['PHP_SELF'];
5328 } elseif (isset($HTTP_SERVER_VARS)) {
5329 $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
5330 } else {
5331 $this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available");
5332 }
5333 // begin-patch: https://mantis.ilias.de/view.php?id=28866
5334 $PHP_SELF = htmlspecialchars($PHP_SELF, ENT_QUOTES | ENT_HTML5, 'UTF-8');
5335 // end-patch
5336
5337 $b = '
5338 <html><head><title>NuSOAP: ' . $this->serviceName . '</title>
5339 <style type="text/css">
5340 body { font-family: arial; color: #000000; background-color: #ffffff; margin: 0px 0px 0px 0px; }
5341 p { font-family: arial; color: #000000; margin-top: 0px; margin-bottom: 12px; }
5342 pre { background-color: silver; padding: 5px; font-family: Courier New; font-size: x-small; color: #000000;}
5343 ul { margin-top: 10px; margin-left: 20px; }
5344 li { list-style-type: none; margin-top: 10px; color: #000000; }
5345 .content{
5346 margin-left: 0px; padding-bottom: 2em; }
5347 .nav {
5348 padding-top: 10px; padding-bottom: 10px; padding-left: 15px; font-size: .70em;
5349 margin-top: 10px; margin-left: 0px; color: #000000;
5350 background-color: #ccccff; width: 20%; margin-left: 20px; margin-top: 20px; }
5351 .title {
5352 font-family: arial; font-size: 26px; color: #ffffff;
5353 background-color: #999999; width: 105%; margin-left: 0px;
5354 padding-top: 10px; padding-bottom: 10px; padding-left: 15px;}
5355 .hidden {
5356 position: absolute; visibility: hidden; z-index: 200; left: 250px; top: 100px;
5357 font-family: arial; overflow: hidden; width: 600;
5358 padding: 20px; font-size: 10px; background-color: #999999;
5359 layer-background-color:#FFFFFF; }
5360 a,a:active { color: charcoal; font-weight: bold; }
5361 a:visited { color: #666666; font-weight: bold; }
5362 a:hover { color: cc3300; font-weight: bold; }
5363 </style>
5364 <script language="JavaScript" type="text/javascript">
5365 <!--
5366 // POP-UP CAPTIONS...
5367 function lib_bwcheck(){ //Browsercheck (needed)
5368 this.ver=navigator.appVersion
5369 this.agent=navigator.userAgent
5370 this.dom=document.getElementById?1:0
5371 this.opera5=this.agent.indexOf("Opera 5")>-1
5372 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
5373 this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
5374 this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
5375 this.ie=this.ie4||this.ie5||this.ie6
5376 this.mac=this.agent.indexOf("Mac")>-1
5377 this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
5378 this.ns4=(document.layers && !this.dom)?1:0;
5379 this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
5380 return this
5381 }
5382 var bw = new lib_bwcheck()
5383 //Makes crossbrowser object.
5384 function makeObj(obj){
5385 this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
5386 if(!this.evnt) return false
5387 this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;
5388 this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;
5389 this.writeIt=b_writeIt;
5390 return this
5391 }
5392 // A unit of measure that will be added when setting the position of a layer.
5393 //var px = bw.ns4||window.opera?"":"px";
5394 function b_writeIt(text){
5395 if (bw.ns4){this.wref.write(text);this.wref.close()}
5396 else this.wref.innerHTML = text
5397 }
5398 //Shows the messages
5399 var oDesc;
5400 function popup(divid){
5401 if(oDesc = new makeObj(divid)){
5402 oDesc.css.visibility = "visible"
5403 }
5404 }
5405 function popout(){ // Hides message
5406 if(oDesc) oDesc.css.visibility = "hidden"
5407 }
5408 //-->
5409 </script>
5410 </head>
5411 <body>
5412 <div class=content>
5413 <br><br>
5414 <div class=title>' . $this->serviceName . '</div>
5415 <div class=nav>
5416 <p>View the <a href="' . $PHP_SELF . '?wsdl">WSDL</a> for the service.
5417 Click on an operation name to view it&apos;s details.</p>
5418 <ul>';
5419 foreach ($this->getOperations() as $op => $data) {
5420 // begin-patch: https://mantis.ilias.de/view.php?id=28866
5421 if (isset($data['endpoint'])) {
5422 $data['endpoint'] = htmlspecialchars($data['endpoint'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
5423 }
5424 // end-patch
5425 $b .= "<li><a href='#' onclick=\"popout();popup('$op')\">$op</a></li>";
5426 // create hidden div
5427 $b .= "<div id='$op' class='hidden'>
5428 <a href='#' onclick='popout()'><font color='#ffffff'>Close</font></a><br><br>";
5429 foreach ($data as $donnie => $marie) { // loop through opdata
5430 if ($donnie == 'input' || $donnie == 'output') { // show input/output data
5431 $b .= "<font color='white'>" . ucfirst($donnie) . ':</font><br>';
5432 foreach ($marie as $captain => $tenille) { // loop through data
5433 if ($captain == 'parts') { // loop thru parts
5434 $b .= "&nbsp;&nbsp;$captain:<br>";
5435 //if(is_array($tenille)){
5436 foreach ($tenille as $joanie => $chachi) {
5437 $b .= "&nbsp;&nbsp;&nbsp;&nbsp;$joanie: $chachi<br>";
5438 }
5439 //}
5440 } else {
5441 $b .= "&nbsp;&nbsp;$captain: $tenille<br>";
5442 }
5443 }
5444 } else {
5445 $b .= "<font color='white'>" . ucfirst($donnie) . ":</font> $marie<br>";
5446 }
5447 }
5448 $b .= '</div>';
5449 }
5450 $b .= '
5451 <ul>
5452 </div>
5453 </div></body></html>';
5454 return $b;
5455 }
getOperations($bindingType='soap')
returns an assoc array of operation names => operation data
Definition: nusoap.php:5162
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26

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

Referenced by nusoap_server\service().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $authtype

wsdl::$authtype = ''

Definition at line 4627 of file nusoap.php.

Referenced by setCredentials().

◆ $bindings

wsdl::$bindings = array()

Definition at line 4600 of file nusoap.php.

◆ $certRequest

wsdl::$certRequest = array()

Definition at line 4628 of file nusoap.php.

Referenced by setCredentials().

◆ $complexTypes

wsdl::$complexTypes = array()

Definition at line 4594 of file nusoap.php.

◆ $curl_options

wsdl::$curl_options = array()

Definition at line 4622 of file nusoap.php.

Referenced by __construct().

◆ $currentBinding

wsdl::$currentBinding

Definition at line 4601 of file nusoap.php.

Referenced by start_element().

◆ $currentMessage

wsdl::$currentMessage

Definition at line 4596 of file nusoap.php.

Referenced by start_element().

◆ $currentOperation

wsdl::$currentOperation

Definition at line 4597 of file nusoap.php.

Referenced by start_element().

◆ $currentPort

wsdl::$currentPort

Definition at line 4603 of file nusoap.php.

Referenced by start_element().

◆ $currentPortOperation

wsdl::$currentPortOperation

Definition at line 4588 of file nusoap.php.

Referenced by start_element().

◆ $currentPortType

wsdl::$currentPortType

Definition at line 4599 of file nusoap.php.

Referenced by start_element().

◆ $currentSchema

wsdl::$currentSchema

Definition at line 4592 of file nusoap.php.

Referenced by end_element().

◆ $depth

wsdl::$depth = 0

Definition at line 4613 of file nusoap.php.

Referenced by character_data(), and start_element().

◆ $depth_array

wsdl::$depth_array = array()

Definition at line 4614 of file nusoap.php.

◆ $documentation

wsdl::$documentation = false

Definition at line 4606 of file nusoap.php.

Referenced by addOperation().

◆ $endpoint

wsdl::$endpoint = ''

Definition at line 4607 of file nusoap.php.

◆ $import

wsdl::$import = array()

Definition at line 4609 of file nusoap.php.

◆ $message

wsdl::$message = array()

Definition at line 4593 of file nusoap.php.

◆ $messages

wsdl::$messages = array()

Definition at line 4595 of file nusoap.php.

◆ $opData

wsdl::$opData = array()

◆ $opStatus

wsdl::$opStatus

Definition at line 4587 of file nusoap.php.

Referenced by start_element().

◆ $parser

wsdl::$parser

Definition at line 4611 of file nusoap.php.

Referenced by end_element(), and start_element().

◆ $password

wsdl::$password = ''

Definition at line 4626 of file nusoap.php.

Referenced by setCredentials().

◆ $ports

wsdl::$ports = array()

Definition at line 4602 of file nusoap.php.

◆ $portTypes

wsdl::$portTypes = array()

Definition at line 4598 of file nusoap.php.

◆ $position

wsdl::$position = 0

Definition at line 4612 of file nusoap.php.

◆ $proxyhost

wsdl::$proxyhost = ''

Definition at line 4616 of file nusoap.php.

Referenced by __construct().

◆ $proxypassword

wsdl::$proxypassword = ''

Definition at line 4619 of file nusoap.php.

Referenced by __construct().

◆ $proxyport

wsdl::$proxyport = ''

Definition at line 4617 of file nusoap.php.

Referenced by __construct().

◆ $proxyusername

wsdl::$proxyusername = ''

Definition at line 4618 of file nusoap.php.

Referenced by __construct().

◆ $response_timeout

wsdl::$response_timeout = 30

Definition at line 4621 of file nusoap.php.

Referenced by __construct().

◆ $schemas

wsdl::$schemas = array()

Definition at line 4591 of file nusoap.php.

◆ $serviceName

wsdl::$serviceName

Definition at line 4586 of file nusoap.php.

◆ $status

wsdl::$status = ''

Definition at line 4605 of file nusoap.php.

◆ $timeout

wsdl::$timeout = 0

Definition at line 4620 of file nusoap.php.

Referenced by __construct().

◆ $use_curl

wsdl::$use_curl = false

Definition at line 4623 of file nusoap.php.

Referenced by __construct().

◆ $username

wsdl::$username = ''

Definition at line 4625 of file nusoap.php.

Referenced by setCredentials().

◆ $wsdl

wsdl::$wsdl

Definition at line 4589 of file nusoap.php.

Referenced by __construct(), fetchWSDL(), and parseWSDL().


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