ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBMFWSDL Class Reference
+ Inheritance diagram for ilBMFWSDL:
+ Collaboration diagram for ilBMFWSDL:

Public Member Functions

 ilBMFWSDL ($wsdl_uri=false, $proxy=array(), $cacheUse=WSDL_CACHE_USE, $cacheMaxAge=WSDL_CACHE_MAX_AGE, $docs=false)
 ilBMFWSDL constructor.
 set_service ($service)
 parse ($wsdl_uri, $proxy=array())
 parseURL ($wsdl_uri, $proxy=array())
 Fills the WSDL array tree with data from a WSDL file.
 parseObject (&$wsdl_obj, $targetNamespace, $service_name, $service_desc= '')
 Fills the WSDL array tree with data from one or more PHP class objects.
 getEndpoint ($portName)
 _getPortName ($operation, $service)
 getPortName ($operation, $service=null)
 Finds the name of the first port that contains an operation of name $operation.
 getOperationData ($portName, $operation)
 matchMethod (&$operation)
 getDataHandler ($datatype, $namespace)
 Given a datatype, what function handles the processing?
 getSoapAction ($portName, $operation)
 getNamespace ($portName, $operation)
 getNamespaceAttributeName ($namespace)
 addNamespace ($namespace)
 _validateString ($string)
 _addArg (&$args, &$argarray, $argname)
 _elementArg (&$args, &$argarray, &$_argtype, $_argname)
 _complexTypeArg (&$args, &$argarray, &$_argtype, $_argname)
 generateProxyCode ($port= '', $classname= '')
 Generates stub code from the WSDL that can be saved to a file or eval'd into existence.
 generateAllProxies ()
getProxy ($port= '', $name= '')
_getComplexTypeForElement ($name, $namespace)
 getComplexTypeNameForElement ($name, $namespace)
 getComplexTypeChildType ($ns, $name, $child_ns, $child_name)
 getSchemaType ($type, $name, $type_namespace)
 _getDeepestArrayType ($nsPrefix, $arrayType)
 Recurse through the WSDL structure looking for the innermost array type of multi-dimensional arrays.
- Public Member Functions inherited from ilBMFBase
 ilBMFBase ($faultcode= 'Client')
 Constructor.
 _resetNamespaces ()
 _setSchemaVersion ($schemaVersion)
 Sets the schema version used in the SOAP message.
 _getNamespacePrefix ($ns)
 _getNamespaceForPrefix ($prefix)
 _isSoapValue (&$value)
 _serializeValue (&$value, $name= '', $type=false, $elNamespace=NULL, $typeNamespace=NULL, $options=array(), $attributes=array(), $artype='', $OBJTypeNS=array())
 _getType (&$value)
 Converts a PHP type to a SOAP type.
 _multiArrayType (&$value, &$type, &$size, &$xml)
 _isBase64 (&$value)
 Returns whether a string is base64 encoded data.
 _isBase64Type ($type)
 Returns whether a type is a base64 type.
 _isHash (&$a)
 Returns whether an array is a hash.
 _un_htmlentities ($string)
_decode (&$soapval)
 _makeEnvelope (&$method, &$headers, $encoding=SOAP_DEFAULT_ENCODING, $options=array())
 Creates the SOAP envelope with the SOAP envelop data.
 _makeMimeMessage (&$xml, $encoding=SOAP_DEFAULT_ENCODING)
 _makeDIMEMessage ($xml)
 _decodeMimeMessage (&$data, &$headers, &$attachments)
 _decodeDIMEMessage (&$data, &$headers, &$attachments)
 __set_type_translation ($type, $class=null)
- Public Member Functions inherited from ilBMFBase_Object
 ilBMFBase_Object ($faultcode= 'Client')
 Constructor.
_raiseSoapFault ($str, $detail= '', $actorURI= '', $code=null, $mode=null, $options=null, $skipmsg=false)
 Raises a SOAP error.
 __isfault ()
__getfault ()
 _debug ($string)
 Adds a string to the debug data.
- Public Member Functions inherited from PEAR
 PEAR ($error_class=null)
 Constructor.
 _PEAR ()
 Destructor (the emulated type of...).
getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them.
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes.
 isError ($data, $code=null)
 Tell whether a value is a PEAR error.
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled.
 expectError ($code= '*')
 This method is used to tell which errors you expect to get.
 popExpect ()
 This method pops one element off the expected error codes stack.
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available.
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack.
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied.
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options.
 staticPushErrorHandling ($mode, $options=null)
 staticPopErrorHandling ()
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack.
 popErrorHandling ()
 Pop the last error handler used.
 loadExtension ($ext)
 OS independant PHP extension load.

Data Fields

 $tns = null
 $definition = array()
 $namespaces = array()
 $ns = array()
 $xsd = SOAP_XML_SCHEMA_VERSION
 $complexTypes = array()
 $elements = array()
 $messages = array()
 $portTypes = array()
 $bindings = array()
 $imports = array()
 $services = array()
 $service = ''
 $uri = ''
 $docs = false
 $proxy = null
 $trace = 0
 $cacheUse = null
 $cacheMaxAge = null
 $wsdlParserClass = 'ilBMFWSDL_Parser'
- Data Fields inherited from ilBMFBase
 $_XMLSchema
 $_XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'
 $_typemap
 $_defaultObjectClassname = 'stdClass'
 Default class name to use for decoded response objects.
 $_namespaces
 $_namespace
 $_xmlEntities
 $_doconversion = false
 $__attachments = array()
 $_wsdl = null
 $_section5 = true
 True if we use section 5 encoding, or false if this is literal.
 $_auto_translation = false
 $_type_translation = array()
- Data Fields inherited from ilBMFBase_Object
 $_debug_flag = false
 Store debugging information in $_debug_data?
 $_debug_data = ''
 String containing debugging information if $_debug_flag is true.
 $_encodings = array('ISO-8859-1', 'US-ASCII', 'UTF-8')
 Supported encodings, limited by XML extension.
 $_myfaultcode = ''
 Fault code.
 $fault = null
 Recent PEAR_Error object.
- Data Fields inherited from PEAR
 $_debug = false
 $_default_error_mode = null
 $_default_error_options = null
 $_default_error_handler = ''
 $_error_class = 'PEAR_Error'
 $_expected_errors = array()

Detailed Description

Definition at line 49 of file class.ilBMFWSDL.php.

Member Function Documentation

ilBMFWSDL::_addArg ( $args,
$argarray,
  $argname 
)

Definition at line 441 of file class.ilBMFWSDL.php.

References _validateString().

Referenced by _complexTypeArg(), _elementArg(), and generateProxyCode().

{
if ($args) {
$args .= ', ';
}
$args .= '$' . $argname;
if (!$this->_validateString($argname)) {
return;
}
if ($argarray) {
$argarray .= ', ';
}
$argarray .= "'$argname' => $" . $argname;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBMFWSDL::_complexTypeArg ( $args,
$argarray,
$_argtype,
  $_argname 
)

Definition at line 499 of file class.ilBMFWSDL.php.

References _addArg().

Referenced by generateProxyCode().

{
$comments = '';
if (isset($this->complexTypes[$_argtype['namespace']][$_argtype['type']])) {
$comments = " // $_argname is a ComplexType {$_argtype['type']},\n" .
" // refer to wsdl for more info\n";
if (isset($this->complexTypes[$_argtype['namespace']][$_argtype['type']]['attribute'])) {
$comments .= " // $_argname may require attributes, refer to wsdl for more info\n";
}
$wrapname = '{' . $this->namespaces[$_argtype['namespace']].'}' . $_argtype['type'];
$comments .= " \$$_argname =& new ilBMFValue('$_argname', '$wrapname', \$$_argname);\n";
}
$this->_addArg($args, $argarray, $_argname);
return $comments;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBMFWSDL::_elementArg ( $args,
$argarray,
$_argtype,
  $_argname 
)

Definition at line 456 of file class.ilBMFWSDL.php.

References $tns, and _addArg().

Referenced by generateProxyCode().

{
$comments = '';
$el = $this->elements[$_argtype['namespace']][$_argtype['type']];
$tns = isset($this->ns[$el['namespace']])
? $this->ns[$el['namespace']]
: $_argtype['namespace'];
if (!empty($el['complex']) ||
(isset($el['type']) &&
isset($this->complexTypes[$tns][$el['type']]))) {
// The element is a complex type.
$comments .= " // {$_argtype['type']} is a ComplexType, refer to the WSDL for more info.\n";
$attrname = "{$_argtype['type']}_attr";
if (isset($el['type']) &&
isset($this->complexTypes[$tns][$el['type']]['attribute'])) {
$comments .= " // {$_argtype['type']} may require attributes, refer to the WSDL for more info.\n";
}
$comments .= " \${$attrname}['xmlns'] = '{$this->namespaces[$_argtype['namespace']]}';\n";
$comments .= " \${$_argtype['type']} =& new ilBMFValue('{$_argtype['type']}', false, \${$_argtype['type']}, \$$attrname);\n";
$this->_addArg($args, $argarray, $_argtype['type']);
if (isset($el['type']) &&
isset($this->complexTypes[$tns][$el['type']]['attribute'])) {
if ($args) {
$args .= ', ';
}
$args .= '$' . $attrname;
}
} elseif (isset($el['elements'])) {
foreach ($el['elements'] as $ename => $element) {
$comments .= " \$$ename =& new ilBMFValue('{{$this->namespaces[$element['namespace']]}}$ename', '" .
(isset($element['type']) ? $element['type'] : false) .
"', \$$ename);\n";
$this->_addArg($args, $argarray, $ename);
}
} else {
$comments .= " \$$_argname =& new ilBMFValue('{{$this->namespaces[$tns]}}$_argname', '{$el['type']}', \$$_argname);\n";
$this->_addArg($args, $argarray, $_argname);
}
return $comments;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilBMFWSDL::_getComplexTypeForElement (   $name,
  $namespace 
)

Definition at line 734 of file class.ilBMFWSDL.php.

References $name, $namespace, $ns, $t, and $type.

Referenced by getComplexTypeChildType(), and getComplexTypeNameForElement().

{
$t = null;
if (isset($this->ns[$namespace]) &&
isset($this->elements[$this->ns[$namespace]][$name]['type'])) {
$type = $this->elements[$this->ns[$namespace]][$name]['type'];
$ns = $this->elements[$this->ns[$namespace]][$name]['namespace'];
if (isset($this->complexTypes[$ns][$type])) {
$t = $this->complexTypes[$ns][$type];
}
}
return $t;
}

+ Here is the caller graph for this function:

ilBMFWSDL::_getDeepestArrayType (   $nsPrefix,
  $arrayType 
)

Recurse through the WSDL structure looking for the innermost array type of multi-dimensional arrays.

Takes a namespace prefix and a type, which can be in the form 'type' or 'type[]', and returns the full namespace URI, the type of the most deeply nested array type found, and the number of levels of nesting.

private

Returns
mixed array or nothing

Definition at line 846 of file class.ilBMFWSDL.php.

Referenced by getSchemaType().

{
static $trail = array();
$arrayType = ereg_replace('\[\]$', '', $arrayType);
// Protect against circular references XXX We really need to remove
// trail from this altogether (it's very inefficient and in the wrong
// place!) and put circular reference checking in when the WSDL info
// is generated in the first place
if (array_search($nsPrefix . ':' . $arrayType, $trail)) {
return array(null, null, -count($trail));
}
if (array_key_exists($nsPrefix, $this->complexTypes) &&
array_key_exists($arrayType, $this->complexTypes[$nsPrefix]) &&
array_key_exists('arrayType', $this->complexTypes[$nsPrefix][$arrayType])) {
$trail[] = $nsPrefix . ':' . $arrayType;
$result = $this->_getDeepestArrayType($this->complexTypes[$nsPrefix][$arrayType]['namespace'],
$this->complexTypes[$nsPrefix][$arrayType]['arrayType']);
return array($result[0], $result[1], $result[2] + 1);
}
return array($this->namespaces[$nsPrefix], $arrayType, 0);
}

+ Here is the caller graph for this function:

ilBMFWSDL::_getPortName (   $operation,
  $service 
)

Definition at line 197 of file class.ilBMFWSDL.php.

References $service, and $type.

Referenced by getPortName().

{
if (isset($this->services[$service]['ports'])) {
$ports = $this->services[$service]['ports'];
foreach ($ports as $port => $portAttrs) {
$type = $ports[$port]['type'];
if ($type == 'soap' &&
isset($this->bindings[$portAttrs['binding']]['operations'][$operation])) {
return $port;
}
}
}
return null;
}

+ Here is the caller graph for this function:

ilBMFWSDL::_validateString (   $string)

Definition at line 436 of file class.ilBMFWSDL.php.

Referenced by _addArg(), and generateProxyCode().

{
return preg_match('/^[\w_:#\/]+$/', $string);
}

+ Here is the caller graph for this function:

ilBMFWSDL::addNamespace (   $namespace)

Definition at line 422 of file class.ilBMFWSDL.php.

References $namespace.

Referenced by getNamespaceAttributeName().

{
if (!empty($this->ns[$namespace])) {
return $this->ns[$namespace];
}
$n = count($this->ns);
$attr = 'ns' . $n;
$this->namespaces['ns' . $n] = $namespace;
$this->ns[$namespace] = $attr;
return $attr;
}

+ Here is the caller graph for this function:

ilBMFWSDL::generateAllProxies ( )

Definition at line 689 of file class.ilBMFWSDL.php.

References $service, and generateProxyCode().

{
$proxycode = '';
foreach (array_keys($this->services[$this->service]['ports']) as $key) {
$port =& $this->services[$this->service]['ports'][$key];
$proxycode .= $this->generateProxyCode($port);
}
return $proxycode;
}

+ Here is the call graph for this function:

ilBMFWSDL::generateProxyCode (   $port = '',
  $classname = '' 
)

Generates stub code from the WSDL that can be saved to a file or eval'd into existence.

Definition at line 521 of file class.ilBMFWSDL.php.

References $namespace, $ns, $service, ilBMFBase_Object\__getfault(), ilBMFBase_Object\__isfault(), _addArg(), _complexTypeArg(), _elementArg(), and _validateString().

Referenced by generateAllProxies(), and getProxy().

{
if ($this->__isfault()) {
return $this->__getfault();
}
$multiport = count($this->services[$this->service]['ports']) > 1;
if (!$port) {
reset($this->services[$this->service]['ports']);
$port = current($this->services[$this->service]['ports']);
}
// XXX currently do not support HTTP ports
if ($port['type'] != 'soap') {
return null;
}
// XXX currentPort is BAD
$clienturl = $port['address']['location'];
if (!$classname) {
if ($multiport || $port) {
$classname = 'WebService_' . $this->service . '_' . $port['name'];
} else {
$classname = 'WebService_' . $this->service;
}
$classname = preg_replace('/[ .\-\(\)]+/', '_', $classname);
}
if (!$this->_validateString($classname)) {
return null;
}
if (is_array($this->proxy) && count($this->proxy)) {
$class = "class $classname extends ilBMFClient\n{\n" .
" function $classname(\$path = '$clienturl')\n {\n" .
" \$this->ilBMFClient(\$path, 0, 0,\n" .
' array(';
foreach ($this->proxy as $key => $val) {
if (is_array($val)) {
$class .= "'$key' => array(";
foreach ($val as $key2 => $val2) {
$class .= "'$key2' => '$val2', ";
}
$class .= ')';
} else {
$class .= "'$key' => '$val', ";
}
}
$class .= "));\n }\n";
$class = str_replace(', ))', '))', $class);
} else {
$class = "class $classname extends ilBMFClient\n{\n" .
" function $classname(\$path = '$clienturl')\n {\n" .
" \$this->ilBMFClient(\$path, 0);\n" .
" }\n";
}
// Get the binding, from that get the port type.
$primaryBinding = $port['binding'];
$primaryBinding = preg_replace("/^(.*:)/", '', $primaryBinding);
$portType = $this->bindings[$primaryBinding]['type'];
$portType = preg_replace("/^(.*:)/", '', $portType);
$style = $this->bindings[$primaryBinding]['style'];
// XXX currentPortType is BAD
foreach ($this->portTypes[$portType] as $opname => $operation) {
$binding = $this->bindings[$primaryBinding]['operations'][$opname];
if (isset($binding['soapAction'])) {
$soapaction = $binding['soapAction'];
} else {
$soapaction = null;
}
if (isset($binding['style'])) {
$opstyle = $binding['style'];
} else {
$opstyle = $style;
}
$use = $binding['input']['use'];
if ($use == 'encoded') {
$namespace = $binding['input']['namespace'];
} else {
$bindingType = $this->bindings[$primaryBinding]['type'];
$ns = $this->portTypes[$bindingType][$opname]['input']['namespace'];
$namespace = $this->namespaces[$ns];
}
$args = '';
$argarray = '';
$comments = '';
$wrappers = '';
foreach ($operation['input'] as $argname => $argtype) {
if ($argname == 'message') {
foreach ($this->messages[$argtype] as $_argname => $_argtype) {
if ($opstyle == 'document' && $use == 'literal' &&
$_argtype['name'] == 'parameters') {
// The type or element refered to is used for
// parameters.
$elattrs = null;
$element = $_argtype['element'];
$el = $this->elements[$_argtype['namespace']][$_argtype['type']];
if ($el['complex']) {
$namespace = $this->namespaces[$_argtype['namespace']];
// XXX need to wrap the parameters in a
// ilBMFValue.
}
if (isset($el['elements'])) {
foreach ($el['elements'] as $elname => $elattrs) {
// Is the element a complex type?
if (isset($this->complexTypes[$elattrs['namespace']][$elname])) {
$comments .= $this->_complexTypeArg($args, $argarray, $_argtype, $_argname);
} else {
$this->_addArg($args, $argarray, $elname);
}
}
}
if ($el['complex'] && $argarray) {
$wrapname = '{' . $this->namespaces[$_argtype['namespace']].'}' . $el['name'];
$comments .= " \${$el['name']} =& new ilBMFValue('$wrapname', false, \$v = array($argarray));\n";
$argarray = "'{$el['name']}' => \${$el['name']}";
}
} else {
if (isset($_argtype['element'])) {
// Element argument.
$comments .= $this->_elementArg($args, $argarray, $_argtype, $_argtype['type']);
} else {
// Complex type argument.
$comments .= $this->_complexTypeArg($args, $argarray, $_argtype, $_argname);
}
}
}
}
}
// Validate entries.
// Operation names are function names, so try to make sure it's
// legal. This could potentially cause collisions, but let's try
// to make everything callable and see how many problems that
// causes.
$opname_php = preg_replace('/[ .\-\(\)]+/', '_', $opname);
if (!$this->_validateString($opname_php)) {
return null;
}
if ($argarray) {
$argarray = "array($argarray)";
} else {
$argarray = 'null';
}
$class .= " function &$opname_php($args)\n {\n$comments$wrappers" .
" \$result = \$this->call('$opname',\n" .
" \$v = $argarray,\n" .
" array('namespace' => '$namespace',\n" .
" 'soapaction' => '$soapaction',\n" .
" 'style' => '$opstyle',\n" .
" 'use' => '$use'" .
($this->trace?",\n 'trace' => 1" : '') . "));\n" .
" return \$result;\n" .
" }\n";
}
$class .= "}\n";
return $class;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBMFWSDL::getComplexTypeChildType (   $ns,
  $name,
  $child_ns,
  $child_name 
)

Definition at line 759 of file class.ilBMFWSDL.php.

References $name, $ns, $t, and _getComplexTypeForElement().

{
// is the type an element?
if ($t) {
// no, get it from complex types directly
if (isset($t['elements'][$child_name]['type']))
return $t['elements'][$child_name]['type'];
}
return null;
}

+ Here is the call graph for this function:

ilBMFWSDL::getComplexTypeNameForElement (   $name,
  $namespace 
)

Definition at line 750 of file class.ilBMFWSDL.php.

References $name, $namespace, $t, and _getComplexTypeForElement().

{
if ($t) {
return $t['name'];
}
return null;
}

+ Here is the call graph for this function:

ilBMFWSDL::getDataHandler (   $datatype,
  $namespace 
)

Given a datatype, what function handles the processing?

This is used for doc/literal requests where we receive a datatype, and we need to pass it to a method in out server class.

Parameters
string$datatype
string$namespace
Returns
string public

Definition at line 342 of file class.ilBMFWSDL.php.

References $namespace.

{
// See if we have an element by this name.
if (isset($this->namespaces[$namespace])) {
$namespace = $this->namespaces[$namespace];
}
if (isset($this->ns[$namespace])) {
$nsp = $this->ns[$namespace];
//if (!isset($this->elements[$nsp]))
// $nsp = $this->namespaces[$nsp];
if (isset($this->elements[$nsp][$datatype])) {
$checkmessages = array();
// Find what messages use this datatype.
foreach ($this->messages as $messagename => $message) {
foreach ($message as $partname => $part) {
if ($part['type'] == $datatype) {
$checkmessages[] = $messagename;
break;
}
}
}
// Find the operation that uses this message.
$dataHandler = null;
foreach($this->portTypes as $portname => $porttype) {
foreach ($porttype as $opname => $opinfo) {
foreach ($checkmessages as $messagename) {
if ($opinfo['input']['message'] == $messagename) {
return $opname;
}
}
}
}
}
}
return null;
}
ilBMFWSDL::getEndpoint (   $portName)

Definition at line 186 of file class.ilBMFWSDL.php.

References $service, ilBMFBase_Object\__getfault(), ilBMFBase_Object\__isfault(), and ilBMFBase_Object\_raiseSoapFault().

{
if ($this->__isfault()) {
return $this->__getfault();
}
return (isset($this->services[$this->service]['ports'][$portName]['address']['location']))
? $this->services[$this->service]['ports'][$portName]['address']['location']
: $this->_raiseSoapFault("No endpoint for port for $portName", $this->uri);
}

+ Here is the call graph for this function:

ilBMFWSDL::getNamespace (   $portName,
  $operation 
)

Definition at line 394 of file class.ilBMFWSDL.php.

References $service, ilBMFBase_Object\__getfault(), and ilBMFBase_Object\__isfault().

{
if ($this->__isfault()) {
return $this->__getfault();
}
if (!empty($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace'])) {
return $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace'];
}
return false;
}

+ Here is the call graph for this function:

ilBMFWSDL::getNamespaceAttributeName (   $namespace)

Definition at line 407 of file class.ilBMFWSDL.php.

References $namespace, and addNamespace().

{
/* If it doesn't exist at first, flip the array and check again. */
if (empty($this->ns[$namespace])) {
$this->ns = array_flip($this->namespaces);
}
/* If it doesn't exist now, add it. */
if (empty($this->ns[$namespace])) {
return $this->addNamespace($namespace);
}
return $this->ns[$namespace];
}

+ Here is the call graph for this function:

ilBMFWSDL::getOperationData (   $portName,
  $operation 
)

Definition at line 242 of file class.ilBMFWSDL.php.

References $type, ilBMFBase_Object\__getfault(), ilBMFBase_Object\__isfault(), and ilBMFBase_Object\_raiseSoapFault().

{
if ($this->__isfault()) {
return $this->__getfault();
}
if (!isset($this->services[$this->service]['ports'][$portName]['binding']) ||
!($binding = $this->services[$this->service]['ports'][$portName]['binding'])) {
return $this->_raiseSoapFault("No binding for port $portName in WSDL.", $this->uri);
}
// Get operation data from binding.
if (is_array($this->bindings[$binding]['operations'][$operation])) {
$opData = $this->bindings[$binding]['operations'][$operation];
}
// get operation data from porttype
$portType = $this->bindings[$binding]['type'];
if (!$portType) {
return $this->_raiseSoapFault("No port type for binding $binding in WSDL.", $this->uri);
}
if (is_array($type = $this->portTypes[$portType][$operation])) {
if (isset($type['parameterOrder'])) {
$opData['parameterOrder'] = $type['parameterOrder'];
}
$opData['input'] = array_merge($opData['input'], $type['input']);
$opData['output'] = array_merge($opData['output'], $type['output']);
}
if (!$opData)
return $this->_raiseSoapFault("No operation $operation for port $portName in WSDL.", $this->uri);
$opData['parameters'] = false;
if (isset($this->bindings[$binding]['operations'][$operation]['input']['namespace']))
$opData['namespace'] = $this->bindings[$binding]['operations'][$operation]['input']['namespace'];
// Message data from messages.
$inputMsg = $opData['input']['message'];
if (is_array($this->messages[$inputMsg])) {
foreach ($this->messages[$inputMsg] as $pname => $pattrs) {
if ($opData['style'] == 'document' &&
$opData['input']['use'] == 'literal' &&
$pname == 'parameters') {
$opData['parameters'] = true;
$opData['namespace'] = $this->namespaces[$pattrs['namespace']];
$el = $this->elements[$pattrs['namespace']][$pattrs['type']];
if (isset($el['elements'])) {
foreach ($el['elements'] as $elname => $elattrs) {
$opData['input']['parts'][$elname] = $elattrs;
}
}
} else {
$opData['input']['parts'][$pname] = $pattrs;
}
}
}
$outputMsg = $opData['output']['message'];
if (is_array($this->messages[$outputMsg])) {
foreach ($this->messages[$outputMsg] as $pname => $pattrs) {
if ($opData['style'] == 'document' &&
$opData['output']['use'] == 'literal' &&
$pname == 'parameters') {
$el = $this->elements[$pattrs['namespace']][$pattrs['type']];
if (isset($el['elements'])) {
foreach ($el['elements'] as $elname => $elattrs) {
$opData['output']['parts'][$elname] = $elattrs;
}
}
} else {
$opData['output']['parts'][$pname] = $pattrs;
}
}
}
return $opData;
}

+ Here is the call graph for this function:

ilBMFWSDL::getPortName (   $operation,
  $service = null 
)

Finds the name of the first port that contains an operation of name $operation.

Always returns a SOAP portName.

Definition at line 216 of file class.ilBMFWSDL.php.

References $service, ilBMFBase_Object\__getfault(), ilBMFBase_Object\__isfault(), _getPortName(), and ilBMFBase_Object\_raiseSoapFault().

{
if ($this->__isfault()) {
return $this->__getfault();
}
if (!$service) {
}
if (isset($this->services[$service]['ports'])) {
if ($portName = $this->_getPortName($operation, $service)) {
return $portName;
}
}
// Try any service in the WSDL.
foreach ($this->services as $serviceName => $service) {
if (isset($this->services[$serviceName]['ports'])) {
if ($portName = $this->_getPortName($operation, $serviceName)) {
$this->service = $serviceName;
return $portName;
}
}
}
return $this->_raiseSoapFault("No operation $operation in WSDL.", $this->uri);
}

+ Here is the call graph for this function:

& ilBMFWSDL::getProxy (   $port = '',
  $name = '' 
)

Definition at line 699 of file class.ilBMFWSDL.php.

References ilBMFBase_Object\$fault, $name, $proxy, $service, ilBMFBase_Object\__getfault(), ilBMFBase_Object\__isfault(), and generateProxyCode().

{
if ($this->__isfault()) {
$fault =& $this->__getfault();
return $fault;
}
$multiport = count($this->services[$this->service]['ports']) > 1;
if (!$port) {
reset($this->services[$this->service]['ports']);
$port = current($this->services[$this->service]['ports']);
}
if ($multiport || $port) {
$classname = 'WebService_' . $this->service . '_' . $port['name'];
} else {
$classname = 'WebService_' . $this->service;
}
if ($name) {
$classname = $name . '_' . $classname;
}
$classname = preg_replace('/[ .\-\(\)]+/', '_', $classname);
if (!class_exists($classname)) {
$proxy = $this->generateProxyCode($port, $classname);
require_once 'SOAP/Client.php';
eval($proxy);
}
$proxy =& new $classname;
return $proxy;
}

+ Here is the call graph for this function:

ilBMFWSDL::getSchemaType (   $type,
  $name,
  $type_namespace 
)

Definition at line 771 of file class.ilBMFWSDL.php.

References $arg, $name, $ns, $type, and _getDeepestArrayType().

{
// see if it's a complex type so we can deal properly with
// SOAPENC:arrayType.
if ($name && $type) {
// XXX TODO:
// look up the name in the wsdl and validate the type.
foreach ($this->complexTypes as $ns => $types) {
if (array_key_exists($type, $types)) {
if (array_key_exists('type', $types[$type])) {
list($arraytype_ns, $arraytype, $array_depth) = isset($types[$type]['arrayType'])?
$this->_getDeepestArrayType($types[$type]['namespace'], $types[$type]['arrayType'])
: array($this->namespaces[$types[$type]['namespace']], null, 0);
return array($types[$type]['type'], $arraytype, $arraytype_ns, $array_depth);
}
if (array_key_exists('arrayType', $types[$type])) {
list($arraytype_ns, $arraytype, $array_depth) =
$this->_getDeepestArrayType($types[$type]['namespace'], $types[$type]['arrayType']);
return array('Array', $arraytype, $arraytype_ns, $array_depth);
}
if (array_key_exists('elements', $types[$type]) &&
array_key_exists($name, $types[$type]['elements'])) {
$type = $types[$type]['elements']['type'];
return array($type, null, $this->namespaces[$types[$type]['namespace']], null);
}
}
}
}
if ($type && $type_namespace) {
$arrayType = null;
// XXX TODO:
// this code currently handles only one way of encoding array types in wsdl
// need to do a generalized function to figure out complex types
$p = $this->ns[$type_namespace];
if ($p &&
array_key_exists($p, $this->complexTypes) &&
array_key_exists($type, $this->complexTypes[$p])) {
if ($arrayType = $this->complexTypes[$p][$type]['arrayType']) {
$type = 'Array';
} elseif ($this->complexTypes[$p][$type]['order']=='sequence' &&
array_key_exists('elements', $this->complexTypes[$p][$type])) {
reset($this->complexTypes[$p][$type]['elements']);
// assume an array
if (count($this->complexTypes[$p][$type]['elements']) == 1) {
$arg = current($this->complexTypes[$p][$type]['elements']);
$arrayType = $arg['type'];
$type = 'Array';
} else {
foreach ($this->complexTypes[$p][$type]['elements'] as $element) {
if ($element['name'] == $type) {
$arrayType = $element['type'];
$type = $element['type'];
}
}
}
} else {
$type = 'Struct';
}
return array($type, $arrayType, $type_namespace, null);
}
}
return array(null, null, null, null);
}

+ Here is the call graph for this function:

ilBMFWSDL::getSoapAction (   $portName,
  $operation 
)

Definition at line 381 of file class.ilBMFWSDL.php.

References $service, ilBMFBase_Object\__getfault(), and ilBMFBase_Object\__isfault().

{
if ($this->__isfault()) {
return $this->__getfault();
}
if (!empty($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['soapAction'])) {
return $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['soapAction'];
}
return false;
}

+ Here is the call graph for this function:

ilBMFWSDL::ilBMFWSDL (   $wsdl_uri = false,
  $proxy = array(),
  $cacheUse = WSDL_CACHE_USE,
  $cacheMaxAge = WSDL_CACHE_MAX_AGE,
  $docs = false 
)

ilBMFWSDL constructor.

Parameters
string$wsdl_uriURL to WSDL file.
array$proxyContains options for HTTP_Request class
See Also
HTTP_Request.
Parameters
boolean$cacheUseUse WSDL caching. Defaults to false.
integer$cacheMaxAgeCache max lifetime (in seconds).
boolean$docsParse documentation in the WSDL? Defaults to false.

public

Definition at line 111 of file class.ilBMFWSDL.php.

References $cacheMaxAge, $cacheUse, $docs, $proxy, ilBMFBase\ilBMFBase(), PEAR\isError(), and parseURL().

{
$this->uri = $wsdl_uri;
$this->proxy = $proxy;
$this->cacheUse = $cacheUse;
$this->cacheMaxAge = $cacheMaxAge;
$this->docs = $docs;
if ($wsdl_uri) {
if (!PEAR::isError($this->parseURL($wsdl_uri))) {
reset($this->services);
$this->service = key($this->services);
}
}
}

+ Here is the call graph for this function:

ilBMFWSDL::matchMethod ( $operation)

Definition at line 315 of file class.ilBMFWSDL.php.

References ilBMFBase_Object\__getfault(), and ilBMFBase_Object\__isfault().

{
if ($this->__isfault()) {
return $this->__getfault();
}
// Overloading lowercases function names :(
foreach ($this->services[$this->service]['ports'] as $port => $portAttrs) {
foreach (array_keys($this->bindings[$portAttrs['binding']]['operations']) as $op) {
if (strcasecmp($op, $operation) == 0) {
$operation = $op;
}
}
}
}

+ Here is the call graph for this function:

ilBMFWSDL::parse (   $wsdl_uri,
  $proxy = array() 
)
Deprecated:
use parseURL instead

Definition at line 142 of file class.ilBMFWSDL.php.

References $proxy, and parseURL().

{
$this->parseURL($wsdl_uri, $proxy);
}

+ Here is the call graph for this function:

ilBMFWSDL::parseObject ( $wsdl_obj,
  $targetNamespace,
  $service_name,
  $service_desc = '' 
)

Fills the WSDL array tree with data from one or more PHP class objects.

Parameters
mixed$wsdl_objAn object or array of objects to add to the internal WSDL tree.
string$targetNamespaceThe target namespace of schema types etc.
string$service_nameName of the WSDL service.
string$service_descOptional description of the WSDL service.

Definition at line 174 of file class.ilBMFWSDL.php.

References ilBMFBase_Object\_raiseSoapFault().

{
$parser =& new ilBMFWSDL_ObjectParser($wsdl_obj, $this,
$targetNamespace, $service_name,
$service_desc);
if ($parser->fault) {
$this->_raiseSoapFault($parser->fault);
}
}

+ Here is the call graph for this function:

ilBMFWSDL::parseURL (   $wsdl_uri,
  $proxy = array() 
)

Fills the WSDL array tree with data from a WSDL file.

Parameters
string$wsdl_uriURL to WSDL file.
array$proxyContains options for HTTP_Request class
See Also
HTTP_Request.

Definition at line 154 of file class.ilBMFWSDL.php.

References ilBMFBase_Object\_raiseSoapFault().

Referenced by ilBMFWSDL(), and parse().

{
$parser =& new $this->wsdlParserClass($wsdl_uri, $this, $this->docs);
if ($parser->fault) {
$this->_raiseSoapFault($parser->fault);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBMFWSDL::set_service (   $service)

Definition at line 132 of file class.ilBMFWSDL.php.

References $service.

{
if (array_key_exists($service, $this->services)) {
$this->service = $service;
}
}

Field Documentation

ilBMFWSDL::$bindings = array()

Definition at line 60 of file class.ilBMFWSDL.php.

ilBMFWSDL::$cacheMaxAge = null

Definition at line 88 of file class.ilBMFWSDL.php.

Referenced by ilBMFWSDL().

ilBMFWSDL::$cacheUse = null

Definition at line 81 of file class.ilBMFWSDL.php.

Referenced by ilBMFWSDL().

ilBMFWSDL::$complexTypes = array()

Definition at line 56 of file class.ilBMFWSDL.php.

ilBMFWSDL::$definition = array()

Definition at line 52 of file class.ilBMFWSDL.php.

ilBMFWSDL::$docs = false

Definition at line 65 of file class.ilBMFWSDL.php.

Referenced by ilBMFWSDL().

ilBMFWSDL::$elements = array()

Definition at line 57 of file class.ilBMFWSDL.php.

ilBMFWSDL::$imports = array()

Definition at line 61 of file class.ilBMFWSDL.php.

ilBMFWSDL::$messages = array()

Definition at line 58 of file class.ilBMFWSDL.php.

ilBMFWSDL::$namespaces = array()

Definition at line 53 of file class.ilBMFWSDL.php.

ilBMFWSDL::$ns = array()
ilBMFWSDL::$portTypes = array()

Definition at line 59 of file class.ilBMFWSDL.php.

ilBMFWSDL::$proxy = null

Definition at line 72 of file class.ilBMFWSDL.php.

Referenced by getProxy(), ilBMFWSDL(), and parse().

ilBMFWSDL::$services = array()

Definition at line 62 of file class.ilBMFWSDL.php.

ilBMFWSDL::$tns = null

Definition at line 51 of file class.ilBMFWSDL.php.

Referenced by _elementArg().

ilBMFWSDL::$trace = 0

Definition at line 74 of file class.ilBMFWSDL.php.

ilBMFWSDL::$uri = ''

Definition at line 64 of file class.ilBMFWSDL.php.

ilBMFWSDL::$wsdlParserClass = 'ilBMFWSDL_Parser'

Definition at line 96 of file class.ilBMFWSDL.php.

ilBMFWSDL::$xsd = SOAP_XML_SCHEMA_VERSION

Definition at line 55 of file class.ilBMFWSDL.php.


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