Public Member Functions | Data Fields

ilBMFWSDL_Parser Class Reference

Inheritance diagram for ilBMFWSDL_Parser:
Collaboration diagram for ilBMFWSDL_Parser:

Public Member Functions

 ilBMFWSDL_Parser ($uri, &$wsdl, $docs=false)
 parse ($uri)
 startElement ($parser, $name, $attrs)
 endElement ($parser, $name)
 characterData ($parser, $data)
 merge_url ($parsed, $path)
 _normalize ($path_str)

Data Fields

 $currentMessage
 $currentOperation
 $currentPortType
 $currentBinding
 $currentPort
 $cache
 $tns = NULL
 $soapns = array('soap')
 $uri = ''
 $wsdl = NULL
 $status = ''
 $element_stack = array()
 $parentElement = ''
 $schema = ''
 $schemaStatus = ''
 $schema_stack = array()
 $currentComplexType
 $schema_element_stack = array()
 $currentElement

Detailed Description

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


Member Function Documentation

ilBMFWSDL_Parser::_normalize ( path_str  ) 

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

Referenced by merge_url().

                                  {
        $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 
)

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

References $data.

    {
        # store the documentation in the WSDL file
        if ($this->currentTag == 'documentation') {
            if ($this->status ==  'service') {
                $this->wsdl->services[$this->currentService][$this->currentTag] .= $data;
            } else if ($this->status ==  'portType') {
                if ($this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$this->currentTag])
                    $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$this->currentTag] .= data;
                else
                    $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$this->currentTag] = data;
            } else if ($this->status ==  'binding') {
                if ($this->wsdl->bindings[$this->currentBinding][$this->currentTag])
                    $this->wsdl->bindings[$this->currentBinding][$this->currentTag] .= data;
                else
                    $this->wsdl->bindings[$this->currentBinding][$this->currentTag] = data;
            } else if ($this->status ==  'message') {
                if ($this->wsdl->messages[$this->currentMessage][$this->currentTag])
                    $this->wsdl->messages[$this->currentMessage][$this->currentTag] .= data;
                else
                    $this->wsdl->messages[$this->currentMessage][$this->currentTag] = data;
            } else if ($this->status ==  'operation') {
                if ($this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$this->currentTag])
                    $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$this->currentTag] .= data;
                else
                    $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$this->currentTag] = data;
            }
        }
    }

ilBMFWSDL_Parser::endElement ( parser,
name 
)

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

    {
        $stacksize = count($this->element_stack);
        if ($stacksize > 0) {
            if ($this->element_stack[count($this->element_stack)-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) > 0)
                    $this->currentElement = array_pop($this->schema_element_stack);
                else
                    $this->currentElement = '';
            } else if (stristr($name,'element')) {
                if (count($this->schema_element_stack) > 0)
                    $this->currentElement = array_pop($this->schema_element_stack);
                else
                    $this->currentElement = '';
            }
        }
        // position of current element is equal to the last value left in depth_array for my depth
        //$pos = $this->depth_array[$this->depth];
        // bring depth down a notch
        //$this->depth--;
    }

ilBMFWSDL_Parser::ilBMFWSDL_Parser ( uri,
&$  wsdl,
docs = false 
)

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

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

Referenced by startElement().

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

Here is the call graph for this function:

Here is the caller graph for this function:

ilBMFWSDL_Parser::merge_url ( parsed,
path 
)

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

References $uri, and _normalize().

Referenced by startElement().

                                      { 
       
        if (! is_array($parsed)) return false;

        if (isset($parsed['scheme'])) {
            $sep = (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://');
            $uri = $parsed['scheme'] . $sep;
        } else {
            $uri = '';
        }

        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 703 of file class.ilBMFWSDL.php.

References $uri, and ilBMFBase::_raiseSoapFault().

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)));
            //print $fd;
            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 
)

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

References $key, $namespace, $parentElement, $q, $uri, ilBMFBase::_raiseSoapFault(), ilBMFWSDL_Parser(), and merge_url().

                                                  {
        // 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 > 0) {
            $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 > 0) {
                $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;
                    #$this->wsdl->getNamespaceAttributeName
                    if ($qn->ns && array_key_exists($qn->ns, $this->wsdl->namespaces)) {
                        $attrs['namespace'] = $qn->ns;
                    }
                }
                
                $parentElement = '';
                $stack_size = count($this->schema_element_stack);
                if ($stack_size > 0) {
                    $parentElement = $this->schema_element_stack[$stack_size-1];
                }

                if (isset($attrs['ref'])) {
                    $this->currentElement = $attrs['ref'];
                } 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';
                } else if ($this->currentComplexType) {
                    // we're inside a complexType
                    if ($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'] = $attrs['type'];
                    }
                    $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 ($attrs['base']) {
                        $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';
                    }
                }
            break;
            case 'sequence':
                if ($this->schemaStatus == 'complexType') {
                    $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] = 'sequence';
                    #if (!array_key_exists('type',$this->wsdl->complexTypes[$this->schema][$this->currentComplexType])) {
                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Array';
                    #}
                }
            break;
            case 'all':
                $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] = 'all';
                if (!array_key_exists('type',$this->wsdl->complexTypes[$this->schema][$this->currentComplexType])) {
                    $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct';
                }
            break;
            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']);
                } else if (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]['parameterOrder'] = $attrs['parameterOrder'];
                $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[strtolower($qname->ns)]:SCHEMA_WSDL;
            switch($ns) {
            case SCHEMA_SOAP:
                // 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']; 
                    $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;
            case SCHEMA_WSDL:
                // 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;
            case SCHEMA_HTTP:
                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']
                                                        [$this->currentOperation] = $attrs;
                    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;
                }
            case SCHEMA_MIME:
                // 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;
                }
            case SCHEMA_DIME:
                // 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[strtolower($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[strtolower($qname->ns)]:SCHEMA_WSDL;
                switch($ns) {
                case SCHEMA_HTTP:
                    $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['type']='http';
                    break;
                case SCHEMA_SOAP:
                    $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
        // set status
        switch($qname->name) {
        case 'import':
            // sect 2.1.1 wsdl:import attributes: namespace location
            if (array_key_exists('location',$attrs)) {
                $uri = $attrs['location'];
                $location = parse_url($uri);
                if (!isset($location['scheme'])) {
                    $base = parse_url($this->uri);
                    $uri = $this->merge_url($base,$uri);
                }
                $import_parser = new ilBMFWSDL_Parser($uri, $this->wsdl);
                if ($import_parser->fault) {
                    return FALSE;
                }
                $this->currentImport = $attrs['namespace'];
                $this->wsdl->imports[$this->currentImport] = $attrs;
            }
            $this->status = '';
        case 'types':
            // sect 2.2 wsdl:types
            $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->status = 'definitions';
            $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[strtolower($qn->name)] = $value;
                    $this->wsdl->ns[$value] = $qn->name;
                    if ($key == 'targetNamespace' ||
                        strcasecmp($value,SOAP_SCHEMA)==0) {
                        $this->soapns[] = strtolower($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

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

ilBMFWSDL_Parser::$currentBinding

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

ilBMFWSDL_Parser::$currentComplexType

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

ilBMFWSDL_Parser::$currentElement

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

ilBMFWSDL_Parser::$currentMessage

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

ilBMFWSDL_Parser::$currentOperation

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

ilBMFWSDL_Parser::$currentPort

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

ilBMFWSDL_Parser::$currentPortType

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

ilBMFWSDL_Parser::$element_stack = array()

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

ilBMFWSDL_Parser::$parentElement = ''

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

Referenced by startElement().

ilBMFWSDL_Parser::$schema = ''

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

ilBMFWSDL_Parser::$schema_element_stack = array()

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

ilBMFWSDL_Parser::$schema_stack = array()

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

ilBMFWSDL_Parser::$schemaStatus = ''

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

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

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

ilBMFWSDL_Parser::$status = ''

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

ilBMFWSDL_Parser::$tns = NULL

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

ilBMFWSDL_Parser::$uri = ''

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

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

ilBMFWSDL_Parser::$wsdl = NULL

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

Referenced by ilBMFWSDL_Parser().


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