ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBMFWSDL_Parser Class Reference
+ Inheritance diagram for ilBMFWSDL_Parser:
+ Collaboration diagram for ilBMFWSDL_Parser:

Public Member Functions

 ilBMFWSDL_Parser ($uri, &$wsdl, $docs=false)
 constructor
 parse ($uri)
 startElement ($parser, $name, $attrs)
 start-element handler
 endElement ($parser, $name)
 end-element handler.
 characterData ($parser, $data)
 Element content handler.
 mergeUrl ($parsed, $path)
 $parsed is an array returned by parse_url().
 _normalize ($path_str)
- 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

 $currentMessage
 Define internal arrays of bindings, ports, operations, messages, etc.
 $currentOperation
 $currentPortType
 $currentBinding
 $currentPort
 $cache
 Parser vars.
 $tns = null
 $soapns = array('soap')
 $uri = ''
 $wsdl = null
 $status = ''
 $element_stack = array()
 $parentElement = ''
 $schema = ''
 $schemaStatus = ''
 $schema_stack = array()
 $currentComplexType
 $schema_element_stack = array()
 $currentElement
- 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 1017 of file class.ilBMFWSDL.php.

Member Function Documentation

ilBMFWSDL_Parser::_normalize (   $path_str)

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

Referenced by mergeUrl().

{
$pwd = '';
$strArr = preg_split('/(\/)/', $path_str, -1, PREG_SPLIT_NO_EMPTY);
$pwdArr = '';
$j = 0;
for ($i = 0; $i < count($strArr); $i++) {
if ($strArr[$i] != ' ..') {
if ($strArr[$i] != ' .') {
$pwdArr[$j] = $strArr[$i];
$j++;
}
} else {
array_pop($pwdArr);
$j--;
}
}
$pStr = implode('/', $pwdArr);
$pwd = (strlen($pStr) > 0) ? ('/' . $pStr) : '/';
return $pwd;
}

+ Here is the caller graph for this function:

ilBMFWSDL_Parser::characterData (   $parser,
  $data 
)

Element content handler.

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

References $currentBinding, $currentComplexType, $currentElement, $currentMessage, $currentOperation, $currentPortType, $data, and $schema.

{
// Store the documentation in the WSDL file.
if ($this->currentTag == 'documentation') {
$data = trim(preg_replace('/\s+/', ' ', $data));
if (!strlen($data)) {
return;
}
switch ($this->status) {
case 'service':
$ptr =& $this->wsdl->services[$this->currentService];
break;
case 'portType':
break;
case 'binding':
$ptr =& $this->wsdl->bindings[$this->currentBinding];
break;
case 'message':
$ptr =& $this->wsdl->messages[$this->currentMessage];
break;
case 'operation':
break;
case 'types':
if (isset($this->currentComplexType) &&
isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType])) {
if ($this->currentElement) {
$ptr =& $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['elements'][$this->currentElement];
} else {
$ptr =& $this->wsdl->complexTypes[$this->schema][$this->currentComplexType];
}
}
break;
}
if (isset($ptr)) {
if (!isset($ptr['documentation'])) {
$ptr['documentation'] = '';
} else {
$ptr['documentation'] .= ' ';
}
$ptr['documentation'] .= $data;
}
}
}
ilBMFWSDL_Parser::endElement (   $parser,
  $name 
)

end-element handler.

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

References $currentComplexType, and $schema.

{
$stacksize = count($this->element_stack);
if ($stacksize) {
if ($this->element_stack[$stacksize - 1] == 'definitions') {
$this->status = '';
}
array_pop($this->element_stack);
}
if (stristr($name, 'schema')) {
array_pop($this->schema_stack);
$this->schema = '';
}
if ($this->schema) {
array_pop($this->schema_stack);
if (count($this->schema_stack) <= 1) {
/* Correct the type for sequences with multiple
* elements. */
if (isset($this->currentComplexType) && isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'])
&& $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] == 'Array'
&& array_key_exists('elements', $this->wsdl->complexTypes[$this->schema][$this->currentComplexType])
&& count($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['elements']) > 1) {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct';
}
}
if (stristr($name, 'complexType')) {
$this->currentComplexType = '';
if (count($this->schema_element_stack)) {
$this->currentElement = array_pop($this->schema_element_stack);
} else {
$this->currentElement = '';
}
} elseif (stristr($name, 'element')) {
if (count($this->schema_element_stack)) {
$this->currentElement = array_pop($this->schema_element_stack);
} else {
$this->currentElement = '';
}
}
}
}
ilBMFWSDL_Parser::ilBMFWSDL_Parser (   $uri,
$wsdl,
  $docs = false 
)

constructor

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

References $uri, $wsdl, ilBMFBase\ilBMFBase(), and parse().

{
parent::ilBMFBase('WSDLPARSER');
$this->cache =& new ilBMFWSDL_Cache($wsdl->cacheUse, $wsdl->cacheMaxAge);
$this->uri = $uri;
$this->wsdl = &$wsdl;
$this->docs = $docs;
$this->parse($uri);
}

+ Here is the call graph for this function:

ilBMFWSDL_Parser::mergeUrl (   $parsed,
  $path 
)

$parsed is an array returned by parse_url().

private

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

References $path, $uri, and _normalize().

Referenced by startElement().

{
if (!is_array($parsed)) {
return false;
}
$uri = '';
if (!empty($parsed['scheme'])) {
$sep = (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://');
$uri = $parsed['scheme'] . $sep;
}
if (isset($parsed['pass'])) {
$uri .= "$parsed[user]:$parsed[pass]@";
} elseif (isset($parsed['user'])) {
$uri .= "$parsed[user]@";
}
if (isset($parsed['host'])) {
$uri .= $parsed['host'];
}
if (isset($parsed['port'])) {
$uri .= ":$parsed[port]";
}
if ($path[0] != '/' && isset($parsed['path'])) {
if ($parsed['path'][strlen($parsed['path']) - 1] != '/') {
$path = dirname($parsed['path']) . '/' . $path;
} else {
$path = $parsed['path'] . $path;
}
$path = $this->_normalize($path);
}
$sep = $path[0] == '/' ? '' : '/';
$uri .= $sep . $path;
return $uri;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBMFWSDL_Parser::parse (   $uri)

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

References $uri, ilBMFBase_Object\_raiseSoapFault(), and PEAR\isError().

Referenced by ilBMFWSDL_Parser().

{
// Check whether content has been read.
$fd = $this->cache->get($uri, $this->wsdl->proxy);
if (PEAR::isError($fd)) {
return $this->_raiseSoapFault($fd);
}
// Create an XML parser.
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_set_object($parser, $this);
xml_set_element_handler($parser, 'startElement', 'endElement');
if ($this->docs) {
xml_set_character_data_handler($parser, 'characterData');
}
if (!xml_parse($parser, $fd, true)) {
$detail = sprintf('XML error on line %d: %s',
xml_get_current_line_number($parser),
xml_error_string(xml_get_error_code($parser)));
return $this->_raiseSoapFault("Unable to parse WSDL file $uri\n$detail");
}
xml_parser_free($parser);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBMFWSDL_Parser::startElement (   $parser,
  $name,
  $attrs 
)

start-element handler

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

References $currentBinding, $currentComplexType, $currentElement, $currentMessage, $currentOperation, $currentPort, $currentPortType, $location, $namespace, $parentElement, $schema, $uri, ilBMFBase_Object\_raiseSoapFault(), mergeUrl(), SCHEMA_DIME, SCHEMA_MIME, SCHEMA_SOAP, SCHEMA_WSDL, SCHEMA_WSDL_HTTP, and SOAP_SCHEMA.

{
// Get element prefix.
$qname =& new QName($name);
if ($qname->ns) {
$ns = $qname->ns;
if ($ns && ((!$this->tns && strcasecmp($qname->name, 'definitions') == 0) || $ns == $this->tns)) {
$name = $qname->name;
}
}
$this->currentTag = $qname->name;
$this->parentElement = '';
$stack_size = count($this->element_stack);
if ($stack_size) {
$this->parentElement = $this->element_stack[$stack_size - 1];
}
$this->element_stack[] = $this->currentTag;
// Find status, register data.
switch ($this->status) {
case 'types':
// sect 2.2 wsdl:types
// children: xsd:schema
$parent_tag = '';
$stack_size = count($this->schema_stack);
if ($stack_size) {
$parent_tag = $this->schema_stack[$stack_size - 1];
}
switch ($qname->name) {
case 'schema':
// No parent should be in the stack.
if (!$parent_tag || $parent_tag == 'types') {
if (array_key_exists('targetNamespace', $attrs)) {
$this->schema = $this->wsdl->getNamespaceAttributeName($attrs['targetNamespace']);
} else {
$this->schema = $this->wsdl->getNamespaceAttributeName($this->wsdl->tns);
}
$this->wsdl->complexTypes[$this->schema] = array();
$this->wsdl->elements[$this->schema] = array();
}
break;
case 'complexType':
if ($parent_tag == 'schema') {
$this->currentComplexType = $attrs['name'];
if (!isset($attrs['namespace'])) {
$attrs['namespace'] = $this->schema;
}
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType] = $attrs;
if (array_key_exists('base', $attrs)) {
$qn =& new QName($attrs['base']);
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = $qn->name;
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['namespace'] = $qn->ns;
} else {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct';
}
$this->schemaStatus = 'complexType';
} else {
$this->wsdl->elements[$this->schema][$this->currentElement]['complex'] = true;
}
break;
case 'element':
if (isset($attrs['type'])) {
$qn =& new QName($attrs['type']);
$attrs['type'] = $qn->name;
if ($qn->ns && array_key_exists($qn->ns, $this->wsdl->namespaces)) {
$attrs['namespace'] = $qn->ns;
}
}
$stack_size = count($this->schema_element_stack);
if ($stack_size > 0) {
$parentElement = $this->schema_element_stack[$stack_size - 1];
}
if (isset($attrs['ref'])) {
$qn =& new QName($attrs['ref']);
$this->currentElement = $qn->name;
} else {
$this->currentElement = $attrs['name'];
}
$this->schema_element_stack[] = $this->currentElement;
if (!isset($attrs['namespace'])) {
$attrs['namespace'] = $this->schema;
}
if ($parent_tag == 'schema') {
$this->wsdl->elements[$this->schema][$this->currentElement] = $attrs;
$this->wsdl->elements[$this->schema][$this->currentElement]['complex'] = false;
$this->schemaStatus = 'element';
} elseif ($this->currentComplexType) {
// we're inside a complexType
if ((isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order']) &&
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] == 'sequence')
&& $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] == 'Array') {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['arrayType'] = isset($attrs['type']) ? $attrs['type'] : null;
}
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['elements'][$this->currentElement] = $attrs;
} else {
$this->wsdl->elements[$this->schema][$parentElement]['elements'][$this->currentElement] = $attrs;
}
break;
case 'complexContent':
case 'simpleContent':
break;
case 'extension':
case 'restriction':
if ($this->schemaStatus == 'complexType') {
if (!empty($attrs['base'])) {
$qn =& new QName($attrs['base']);
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = $qn->name;
// Types that extend from other types aren't
// *of* those types. Reflect this by denoting
// which type they extend. I'm leaving the
// 'type' setting here since I'm not sure what
// removing it might break at the moment.
if ($qname->name == 'extension') {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['extends'] = $qn->name;
}
} else {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct';
}
}
break;
case 'sequence':
if ($this->schemaStatus == 'complexType') {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] = $qname->name;
if (!isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'])) {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Array';
}
}
break;
case 'all':
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] = $qname->name;
if (!isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'])) {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct';
}
break;
case 'choice':
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] = $qname->name;
if (!isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'])) {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Array';
}
case 'attribute':
if ($this->schemaStatus == 'complexType') {
if (isset($attrs['name'])) {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['attribute'][$attrs['name']] = $attrs;
} else {
if (isset($attrs['ref'])) {
$q =& new QName($attrs['ref']);
foreach ($attrs as $k => $v) {
if ($k != 'ref' && strstr($k, $q->name)) {
$vq =& new QName($v);
if ($q->name == 'arrayType') {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType][$q->name] = $vq->name. $vq->arrayInfo;
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Array';
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['namespace'] = $vq->ns;
} else {
$this->wsdl->complexTypes[$this->schema][$this->currentComplexType][$q->name] = $vq->name;
}
}
}
}
}
}
break;
}
$this->schema_stack[] = $qname->name;
break;
case 'message':
// sect 2.3 wsdl:message child wsdl:part
switch ($qname->name) {
case 'part':
$qn = null;
if (isset($attrs['type'])) {
$qn =& new QName($attrs['type']);
} elseif (isset($attrs['element'])) {
$qn =& new QName($attrs['element']);
}
if ($qn) {
$attrs['type'] = $qn->name;
$attrs['namespace'] = $qn->ns;
}
$this->wsdl->messages[$this->currentMessage][$attrs['name']] = $attrs;
// error in wsdl
case 'documentation':
break;
default:
break;
}
break;
case 'portType':
// sect 2.4
switch ($qname->name) {
case 'operation':
// attributes: name
// children: wsdl:input wsdl:output wsdl:fault
$this->currentOperation = $attrs['name'];
$this->wsdl->portTypes[$this->currentPortType][$this->currentOperation] = $attrs;
break;
case 'input':
case 'output':
case 'fault':
// wsdl:input wsdl:output wsdl:fault
// attributes: name message parameterOrder(optional)
if ($this->currentOperation) {
if (isset($this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name])) {
$this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name] = array_merge($this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name], $attrs);
} else {
$this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name] = $attrs;
}
if (array_key_exists('message', $attrs)) {
$qn =& new QName($attrs['message']);
$this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name]['message'] = $qn->name;
$this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name]['namespace'] = $qn->ns;
}
}
break;
case 'documentation':
break;
default:
break;
}
break;
case 'binding':
$ns = $qname->ns ? $this->wsdl->namespaces[$qname->ns] : SCHEMA_WSDL;
switch ($ns) {
// this deals with wsdl section 3 soap binding
switch ($qname->name) {
case 'binding':
// sect 3.3
// soap:binding, attributes: transport(required), style(optional, default = document)
// if style is missing, it is assumed to be 'document'
if (!isset($attrs['style'])) {
$attrs['style'] = 'document';
}
$this->wsdl->bindings[$this->currentBinding] = array_merge($this->wsdl->bindings[$this->currentBinding], $attrs);
break;
case 'operation':
// sect 3.4
// soap:operation, attributes: soapAction(required), style(optional, default = soap:binding:style)
if (!isset($attrs['style'])) {
$attrs['style'] = $this->wsdl->bindings[$this->currentBinding]['style'];
}
if (isset($this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation])) {
$this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation] = array_merge($this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation], $attrs);
} else {
$this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation] = $attrs;
}
break;
case 'body':
// sect 3.5
// soap:body attributes:
// part - optional. listed parts must appear in body, missing means all parts appear in body
// use - required. encoded|literal
// encodingStyle - optional. space seperated list of encodings (uri's)
$this->wsdl->bindings[$this->currentBinding]
['operations'][$this->currentOperation][$this->opStatus] = $attrs;
break;
case 'fault':
// sect 3.6
// soap:fault attributes: name use encodingStyle namespace
$this->wsdl->bindings[$this->currentBinding]
['operations'][$this->currentOperation][$this->opStatus] = $attrs;
break;
case 'header':
// sect 3.7
// soap:header attributes: message part use encodingStyle namespace
$this->wsdl->bindings[$this->currentBinding]
['operations'][$this->currentOperation][$this->opStatus]['headers'][] = $attrs;
break;
case 'headerfault':
// sect 3.7
// soap:header attributes: message part use encodingStyle namespace
$header = count($this->wsdl->bindings[$this->currentBinding]
['operations'][$this->currentOperation][$this->opStatus]['headers'])-1;
$this->wsdl->bindings[$this->currentBinding]
['operations'][$this->currentOperation][$this->opStatus]['headers'][$header]['fault'] = $attrs;
break;
case 'documentation':
break;
default:
// error! not a valid element inside binding
break;
}
break;
// XXX verify correct namespace
// for now, default is the 'wsdl' namespace
// other possible namespaces include smtp, http, etc. for alternate bindings
switch ($qname->name) {
case 'operation':
// sect 2.5
// wsdl:operation attributes: name
$this->currentOperation = $attrs['name'];
break;
case 'output':
case 'input':
case 'fault':
// sect 2.5
// wsdl:input attributes: name
$this->opStatus = $qname->name;
break;
case 'documentation':
break;
default:
break;
}
break;
switch ($qname->name) {
case 'binding':
// sect 4.4
// http:binding attributes: verb
// parent: wsdl:binding
$this->wsdl->bindings[$this->currentBinding] = array_merge($this->wsdl->bindings[$this->currentBinding], $attrs);
break;
case 'operation':
// sect 4.5
// http:operation attributes: location
// parent: wsdl:operation
$this->wsdl->bindings[$this->currentBinding]['operations']
break;
case 'urlEncoded':
// sect 4.6
// http:urlEncoded attributes: location
// parent: wsdl:input wsdl:output etc.
$this->wsdl->bindings[$this->currentBinding]['operations'][$this->opStatus]
[$this->currentOperation]['uri'] = 'urlEncoded';
break;
case 'urlReplacement':
// sect 4.7
// http:urlReplacement attributes: location
// parent: wsdl:input wsdl:output etc.
$this->wsdl->bindings[$this->currentBinding]['operations'][$this->opStatus]
[$this->currentOperation]['uri'] = 'urlReplacement';
break;
case 'documentation':
break;
default:
// error
break;
}
// sect 5
// all mime parts are children of wsdl:input, wsdl:output, etc.
// unsuported as of yet
switch ($qname->name) {
case 'content':
// sect 5.3 mime:content
// <mime:content part="nmtoken"? type="string"?/>
// part attribute only required if content is child of multipart related,
// it contains the name of the part
// type attribute contains the mime type
case 'multipartRelated':
// sect 5.4 mime:multipartRelated
case 'part':
case 'mimeXml':
// sect 5.6 mime:mimeXml
// <mime:mimeXml part="nmtoken"?/>
//
case 'documentation':
break;
default:
// error
break;
}
// DIME is defined in:
// http://gotdotnet.com/team/xml_wsspecs/dime/WSDL-Extension-for-DIME.htm
// all DIME parts are children of wsdl:input, wsdl:output, etc.
// unsuported as of yet
switch ($qname->name) {
case 'message':
// sect 4.1 dime:message
// appears in binding section
$this->wsdl->bindings[$this->currentBinding]['dime'] = $attrs;
break;
default:
break;
}
default:
break;
}
break;
case 'service':
$ns = $qname->ns ? $this->wsdl->namespaces[$qname->ns] : SCHEMA_WSDL;
switch ($qname->name) {
case 'port':
// sect 2.6 wsdl:port attributes: name binding
$this->currentPort = $attrs['name'];
$this->wsdl->services[$this->currentService]['ports'][$this->currentPort] = $attrs;
// XXX hack to deal with binding namespaces
$qn =& new QName($attrs['binding']);
$this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['binding'] = $qn->name;
$this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['namespace'] = $qn->ns;
break;
case 'address':
$this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['address'] = $attrs;
// what TYPE of port is it? SOAP or HTTP?
$ns = $qname->ns ? $this->wsdl->namespaces[$qname->ns] : SCHEMA_WSDL;
switch ($ns) {
$this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['type']='http';
break;
$this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['type']='soap';
break;
default:
// Shouldn't happen, we'll assume SOAP.
$this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['type']='soap';
}
break;
case 'documentation':
break;
default:
break;
}
}
// Top level elements found under wsdl:definitions.
switch ($qname->name) {
case 'import':
// sect 2.1.1 wsdl:import attributes: namespace location
if ((isset($attrs['location']) || isset($attrs['schemaLocation'])) &&
!isset($this->wsdl->imports[$attrs['namespace']])) {
$uri = isset($attrs['location']) ? $attrs['location'] : $attrs['schemaLocation'];
$location = @parse_url($uri);
if (!isset($location['scheme'])) {
$base = @parse_url($this->uri);
$uri = $this->mergeUrl($base, $uri);
}
$this->wsdl->imports[$attrs['namespace']] = $attrs;
$import_parser_class = get_class($this);
$import_parser =& new $import_parser_class($uri, $this->wsdl, $this->docs);
if ($import_parser->fault) {
unset($this->wsdl->imports[$attrs['namespace']]);
return false;
}
$this->currentImport = $attrs['namespace'];
}
// Continue on to the 'types' case - lack of break; is
// intentional.
case 'types':
// sect 2.2 wsdl:types
$this->status = 'types';
break;
case 'schema':
// We can hit this at the top level if we've been asked to
// import an XSD file.
if (!empty($attrs['targetNamespace'])) {
$this->schema = $this->wsdl->getNamespaceAttributeName($attrs['targetNamespace']);
} else {
$this->schema = $this->wsdl->getNamespaceAttributeName($this->wsdl->tns);
}
$this->wsdl->complexTypes[$this->schema] = array();
$this->wsdl->elements[$this->schema] = array();
$this->schema_stack[] = $qname->name;
$this->status = 'types';
break;
case 'message':
// sect 2.3 wsdl:message attributes: name children:wsdl:part
$this->status = 'message';
if (isset($attrs['name'])) {
$this->currentMessage = $attrs['name'];
$this->wsdl->messages[$this->currentMessage] = array();
}
break;
case 'portType':
// sect 2.4 wsdl:portType
// attributes: name
// children: wsdl:operation
$this->status = 'portType';
$this->currentPortType = $attrs['name'];
$this->wsdl->portTypes[$this->currentPortType] = array();
break;
case 'binding':
// sect 2.5 wsdl:binding attributes: name type
// children: wsdl:operation soap:binding http:binding
if ($qname->ns && $qname->ns != $this->tns) {
break;
}
$this->status = 'binding';
$this->currentBinding = $attrs['name'];
$qn =& new QName($attrs['type']);
$this->wsdl->bindings[$this->currentBinding]['type'] = $qn->name;
$this->wsdl->bindings[$this->currentBinding]['namespace'] = $qn->ns;
break;
case 'service':
// sect 2.7 wsdl:service attributes: name children: ports
$this->currentService = $attrs['name'];
$this->wsdl->services[$this->currentService]['ports'] = array();
$this->status = 'service';
break;
case 'definitions':
// sec 2.1 wsdl:definitions
// attributes: name targetNamespace xmlns:*
// children: wsdl:import wsdl:types wsdl:message wsdl:portType wsdl:binding wsdl:service
$this->wsdl->definition = $attrs;
foreach ($attrs as $key => $value) {
if (strstr($key, 'xmlns:') !== false) {
$qn =& new QName($key);
// XXX need to refactor ns handling.
$this->wsdl->namespaces[$qn->name] = $value;
$this->wsdl->ns[$value] = $qn->name;
if ($key == 'targetNamespace' ||
strcasecmp($value,SOAP_SCHEMA) == 0) {
$this->soapns[] = $qn->name;
} else {
if (in_array($value, $this->_XMLSchema)) {
$this->wsdl->xsd = $value;
}
}
}
}
if (isset($ns) && $ns) {
$namespace = 'xmlns:' . $ns;
if (!$this->wsdl->definition[$namespace]) {
return $this->_raiseSoapFault("parse error, no namespace for $namespace", $this->uri);
}
$this->tns = $ns;
}
break;
}
}

+ Here is the call graph for this function:

Field Documentation

ilBMFWSDL_Parser::$cache

Parser vars.

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

ilBMFWSDL_Parser::$currentBinding

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

Referenced by characterData(), and startElement().

ilBMFWSDL_Parser::$currentComplexType

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

Referenced by characterData(), endElement(), and startElement().

ilBMFWSDL_Parser::$currentElement

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

Referenced by characterData(), and startElement().

ilBMFWSDL_Parser::$currentMessage

Define internal arrays of bindings, ports, operations, messages, etc.

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

Referenced by characterData(), and startElement().

ilBMFWSDL_Parser::$currentOperation

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

Referenced by characterData(), and startElement().

ilBMFWSDL_Parser::$currentPort

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

Referenced by startElement().

ilBMFWSDL_Parser::$currentPortType

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

Referenced by characterData(), and startElement().

ilBMFWSDL_Parser::$element_stack = array()

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

ilBMFWSDL_Parser::$parentElement = ''

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

Referenced by startElement().

ilBMFWSDL_Parser::$schema = ''

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

Referenced by characterData(), endElement(), and startElement().

ilBMFWSDL_Parser::$schema_element_stack = array()

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

ilBMFWSDL_Parser::$schema_stack = array()

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

ilBMFWSDL_Parser::$schemaStatus = ''

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

ilBMFWSDL_Parser::$soapns = array('soap')

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

ilBMFWSDL_Parser::$status = ''

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

ilBMFWSDL_Parser::$tns = null

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

ilBMFWSDL_Parser::$uri = ''

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

Referenced by ilBMFWSDL_Parser(), mergeUrl(), parse(), and startElement().

ilBMFWSDL_Parser::$wsdl = null

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

Referenced by ilBMFWSDL_Parser().


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