ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 4581 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 4642 of file nusoap.php.

4643 {
4645 $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
4646 $this->proxyhost = $proxyhost;
4647 $this->proxyport = $proxyport;
4648 $this->proxyusername = $proxyusername;
4649 $this->proxypassword = $proxypassword;
4650 $this->timeout = $timeout;
4651 $this->response_timeout = $response_timeout;
4652 if (is_array($curl_options)) {
4653 $this->curl_options = $curl_options;
4654 }
4655 $this->use_curl = $use_curl;
4656 $this->fetchWSDL($wsdl);
4657 }
debug($string)
adds debug data to the instance debug string with formatting
Definition: nusoap.php:250
$proxyhost
Definition: nusoap.php:4614
$proxypassword
Definition: nusoap.php:4617
fetchWSDL($wsdl)
fetches the WSDL document and parses it
Definition: nusoap.php:4664
$wsdl
Definition: nusoap.php:4587
$timeout
Definition: nusoap.php:4618
$use_curl
Definition: nusoap.php:4621
$proxyusername
Definition: nusoap.php:4616
$proxyport
Definition: nusoap.php:4615
$curl_options
Definition: nusoap.php:4620
$response_timeout
Definition: nusoap.php:4619
__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 6345 of file nusoap.php.

6346 {
6347 if (count($elements) > 0) {
6348 $eElements = array();
6349 foreach ($elements as $n => $e) {
6350 // expand each element
6351 $ee = array();
6352 foreach ($e as $k => $v) {
6353 $k = strpos($k, ':') ? $this->expandQname($k) : $k;
6354 $v = strpos($v, ':') ? $this->expandQname($v) : $v;
6355 $ee[$k] = $v;
6356 }
6357 $eElements[$n] = $ee;
6358 }
6359 $elements = $eElements;
6360 }
6361
6362 if (count($attrs) > 0) {
6363 foreach ($attrs as $n => $a) {
6364 // expand each attribute
6365 foreach ($a as $k => $v) {
6366 $k = strpos($k, ':') ? $this->expandQname($k) : $k;
6367 $v = strpos($v, ':') ? $this->expandQname($v) : $v;
6368 $aa[$k] = $v;
6369 }
6370 $eAttrs[$n] = $aa;
6371 }
6372 $attrs = $eAttrs;
6373 }
6374
6375 $restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
6376 $arrayType = strpos($arrayType, ':') ? $this->expandQname($arrayType) : $arrayType;
6377
6378 $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6379 $this->schemas[$typens][0]->addComplexType($name, $typeClass, $phpType, $compositor, $restrictionBase, $elements, $attrs, $arrayType);
6380 }
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 6408 of file nusoap.php.

6409 {
6410 $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
6411 $this->schemas[$typens][0]->addElement($attrs);
6412 }

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

6429 {
6430 if ($use == 'encoded' && $encodingStyle == '') {
6431 $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
6432 }
6433
6434 if ($style == 'document') {
6435 $elements = array();
6436 foreach ($in as $n => $t) {
6437 $elements[$n] = array('name' => $n, 'type' => $t);
6438 }
6439 $this->addComplexType($name . 'RequestType', 'complexType', 'struct', 'all', '', $elements);
6440 $this->addElement(array('name' => $name, 'type' => $name . 'RequestType'));
6441 $in = array('parameters' => 'tns:' . $name . '^');
6442
6443 $elements = array();
6444 foreach ($out as $n => $t) {
6445 $elements[$n] = array('name' => $n, 'type' => $t);
6446 }
6447 $this->addComplexType($name . 'ResponseType', 'complexType', 'struct', 'all', '', $elements);
6448 $this->addElement(array('name' => $name . 'Response', 'type' => $name . 'ResponseType', 'form' => 'qualified'));
6449 $out = array('parameters' => 'tns:' . $name . 'Response' . '^');
6450 }
6451
6452 // get binding
6453 $this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] =
6454 array(
6455 'name' => $name,
6456 'binding' => $this->serviceName . 'Binding',
6457 'endpoint' => $this->endpoint,
6458 'soapAction' => $soapaction,
6459 'style' => $style,
6460 'input' => array(
6461 'use' => $use,
6462 'namespace' => $namespace,
6463 'encodingStyle' => $encodingStyle,
6464 'message' => $name . 'Request',
6465 'parts' => $in),
6466 'output' => array(
6467 'use' => $use,
6468 'namespace' => $namespace,
6469 'encodingStyle' => $encodingStyle,
6470 'message' => $name . 'Response',
6471 'parts' => $out),
6472 'namespace' => $namespace,
6473 'transport' => 'http://schemas.xmlsoap.org/soap/http',
6474 'documentation' => $documentation);
6475 // add portTypes
6476 // add messages
6477 if ($in) {
6478 foreach ($in as $pName => $pType) {
6479 if (strpos($pType, ':')) {
6480 $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)) . ":" . $this->getLocalPart($pType);
6481 }
6482 $this->messages[$name . 'Request'][$pName] = $pType;
6483 }
6484 } else {
6485 $this->messages[$name . 'Request'] = '0';
6486 }
6487 if ($out) {
6488 foreach ($out as $pName => $pType) {
6489 if (strpos($pType, ':')) {
6490 $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)) . ":" . $this->getLocalPart($pType);
6491 }
6492 $this->messages[$name . 'Response'][$pName] = $pType;
6493 }
6494 } else {
6495 $this->messages[$name . 'Response'] = '0';
6496 }
6497 return true;
6498 }
$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:6408
$documentation
Definition: nusoap.php:4604
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:6345
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 6393 of file nusoap.php.

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

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

5115 {
5116 $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0;
5117 if (isset($this->message[$pos]['cdata'])) {
5118 $this->message[$pos]['cdata'] .= $data;
5119 }
5120 if ($this->documentation) {
5121 $this->documentation .= $data;
5122 }
5123 }
$depth
Definition: nusoap.php:4611

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

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

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

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

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

5145 {
5146 if (is_array($this->bindings[$binding])) {
5147 return $this->bindings[$binding];
5148 }
5149 }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5135 {
5136 $this->debug("setCredentials username=$username authtype=$authtype certRequest=");
5137 $this->appendDebug($this->varDump($certRequest));
5138 $this->username = $username;
5139 $this->password = $password;
5140 $this->authtype = $authtype;
5141 $this->certRequest = $certRequest;
5142 }
$username
Definition: nusoap.php:4623
$certRequest
Definition: nusoap.php:4626
$password
Definition: nusoap.php:4624
$authtype
Definition: nusoap.php:4625

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

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

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

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

Referenced by setCredentials().

◆ $bindings

wsdl::$bindings = array()

Definition at line 4598 of file nusoap.php.

◆ $certRequest

wsdl::$certRequest = array()

Definition at line 4626 of file nusoap.php.

Referenced by setCredentials().

◆ $complexTypes

wsdl::$complexTypes = array()

Definition at line 4592 of file nusoap.php.

◆ $curl_options

wsdl::$curl_options = array()

Definition at line 4620 of file nusoap.php.

Referenced by __construct().

◆ $currentBinding

wsdl::$currentBinding

Definition at line 4599 of file nusoap.php.

Referenced by start_element().

◆ $currentMessage

wsdl::$currentMessage

Definition at line 4594 of file nusoap.php.

Referenced by start_element().

◆ $currentOperation

wsdl::$currentOperation

Definition at line 4595 of file nusoap.php.

Referenced by start_element().

◆ $currentPort

wsdl::$currentPort

Definition at line 4601 of file nusoap.php.

Referenced by start_element().

◆ $currentPortOperation

wsdl::$currentPortOperation

Definition at line 4586 of file nusoap.php.

Referenced by start_element().

◆ $currentPortType

wsdl::$currentPortType

Definition at line 4597 of file nusoap.php.

Referenced by start_element().

◆ $currentSchema

wsdl::$currentSchema

Definition at line 4590 of file nusoap.php.

Referenced by end_element().

◆ $depth

wsdl::$depth = 0

Definition at line 4611 of file nusoap.php.

Referenced by character_data(), and start_element().

◆ $depth_array

wsdl::$depth_array = array()

Definition at line 4612 of file nusoap.php.

◆ $documentation

wsdl::$documentation = false

Definition at line 4604 of file nusoap.php.

Referenced by addOperation().

◆ $endpoint

wsdl::$endpoint = ''

Definition at line 4605 of file nusoap.php.

◆ $import

wsdl::$import = array()

Definition at line 4607 of file nusoap.php.

◆ $message

wsdl::$message = array()

Definition at line 4591 of file nusoap.php.

◆ $messages

wsdl::$messages = array()

Definition at line 4593 of file nusoap.php.

◆ $opData

wsdl::$opData = array()

◆ $opStatus

wsdl::$opStatus

Definition at line 4585 of file nusoap.php.

Referenced by start_element().

◆ $parser

wsdl::$parser

Definition at line 4609 of file nusoap.php.

Referenced by end_element(), and start_element().

◆ $password

wsdl::$password = ''

Definition at line 4624 of file nusoap.php.

Referenced by setCredentials().

◆ $ports

wsdl::$ports = array()

Definition at line 4600 of file nusoap.php.

◆ $portTypes

wsdl::$portTypes = array()

Definition at line 4596 of file nusoap.php.

◆ $position

wsdl::$position = 0

Definition at line 4610 of file nusoap.php.

◆ $proxyhost

wsdl::$proxyhost = ''

Definition at line 4614 of file nusoap.php.

Referenced by __construct().

◆ $proxypassword

wsdl::$proxypassword = ''

Definition at line 4617 of file nusoap.php.

Referenced by __construct().

◆ $proxyport

wsdl::$proxyport = ''

Definition at line 4615 of file nusoap.php.

Referenced by __construct().

◆ $proxyusername

wsdl::$proxyusername = ''

Definition at line 4616 of file nusoap.php.

Referenced by __construct().

◆ $response_timeout

wsdl::$response_timeout = 30

Definition at line 4619 of file nusoap.php.

Referenced by __construct().

◆ $schemas

wsdl::$schemas = array()

Definition at line 4589 of file nusoap.php.

◆ $serviceName

wsdl::$serviceName

Definition at line 4584 of file nusoap.php.

◆ $status

wsdl::$status = ''

Definition at line 4603 of file nusoap.php.

◆ $timeout

wsdl::$timeout = 0

Definition at line 4618 of file nusoap.php.

Referenced by __construct().

◆ $use_curl

wsdl::$use_curl = false

Definition at line 4621 of file nusoap.php.

Referenced by __construct().

◆ $username

wsdl::$username = ''

Definition at line 4623 of file nusoap.php.

Referenced by setCredentials().

◆ $wsdl

wsdl::$wsdl

Definition at line 4587 of file nusoap.php.

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


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