Examples of TypesElement


Examples of org.apache.woden.wsdl20.xml.TypesElement

            // }
            //
            // }

            DescriptionElement descriptionElement = description.toElement();
            TypesElement typesElement = descriptionElement
                    .getTypesElement();
            if (typesElement != null) {
                Schema[] schemas = typesElement.getSchemas();
                for (int i = 0; i < schemas.length; i++) {
                    XmlSchema schemaDefinition = schemas[i].getSchemaDefinition();

                    // WSDL 2.0 spec requires that even the built-in schema should be returned
                    // once asked for schema definitions. But for data binding purposes we can ignore that
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.TypesElement

        XmlSchemaElement xse = null;
        if(fElement != null && fElement.isQName()) {
            InterfaceOperationElement oper = (InterfaceOperationElement)getParentElement();
            InterfaceElement interfac = (InterfaceElement)oper.getParentElement();
            DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
            TypesElement types = desc.getTypesElement();
            if(types != null) {
                xse = ((TypesImpl)types).getElementDeclaration(fElement.getQName());
            }
        }
        return xse;
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.TypesElement

            fDescTypesDone.add(desc);
        }
       
        //process the schema components declared within this description's types element
    URI typeSystemURI = URI.create(Constants.TYPE_XSD_2001); //TODO support other type systems?
        TypesElement types = desc.getTypesElement();
    if (types != null) {
            //first, get the list of imported schema namespaces
            Schema[] importedSchemas = types.getImportedSchemas();
            List importedNSpaces = new Vector();
            for(int j=0; j<importedSchemas.length; j++) {
                URI nsURI = importedSchemas[j].getNamespace();
                if(nsURI != null) {
                    String ns = nsURI.toString();
                    if(!importedNSpaces.contains(ns)) {
                        importedNSpaces.add(ns);
                    }
                }
            }
            //second, process all schemas inlined or imported directly by <types>
            Schema[] schemas = types.getSchemas();
            XmlSchema xmlSchema;
            for(int i=0; i<schemas.length; i++) {
                xmlSchema = schemas[i].getSchemaDefinition();
                if(xmlSchema != null && !fSchemasDone.contains(xmlSchema)) {
                    buildElementsAndTypes(
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.TypesElement

    private TypesElement parseTypes(
            XMLElement typesEl,
            DescriptionElement desc)
            throws WSDLException {

        TypesElement types = desc.addTypesElement();

        //TODO for now set to W3 XML Schema. Later, add support for non-XML Schema type systems
        types.setTypeSystem(Constants.TYPE_XSD_2001);

        parseExtensionAttributes(typesEl, TypesElement.class, types, desc);

        XMLElement[] children = typesEl.getChildElements();
        XMLElement tempEl = null;
        QName tempElQN = null;

        for(int i=0; i<children.length; i++)
        {
            tempEl = children[i];
            tempElQN = tempEl.getQName();

            //TODO validate element order? <documentation> must be first.

            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
            {
                parseDocumentation(tempEl, desc, types);
            }
            else if (SchemaConstants.Q_ELEM_SCHEMA_IMPORT.equals(tempElQN))
            {
                types.addSchema(parseSchemaImport(tempEl, desc));
            }
            else if (SchemaConstants.Q_ELEM_SCHEMA.equals(tempElQN))
            {
                types.addSchema(parseSchemaInline(tempEl, desc));
            }
            else
            {
                types.addExtensionElement(
                        parseExtensionElement(TypesElement.class, types, tempEl, desc) );
            }
        }

        return types;
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.TypesElement

    {
      //Get the namespace and the local name from the qualified name.
      String namespace = qualifiedName.getNamespaceURI();
    String localname = qualifiedName.getLocalPart();     

      TypesElement types = descElement.getTypesElement();
      if(types == null)
      {
      errorReporter.reportError(new ErrorLocatorImpl(), "Schema-1066", new Object[]{localname, namespace}, ErrorReporter.SEVERITY_ERROR);
        return false;
      }
      Schema[] schemas = types.getSchemas();
      int numSchemas = schemas.length;
      boolean schemaNotFound = true;
      // TODO: This linear search should be improved for performance.
      for(int i = 0; i < numSchemas; i++)
      {
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.TypesElement

    {
        XmlSchemaElement xse = null;
        if (fElement != null && fElement.isQName()) {
            InterfaceElement interfac = (InterfaceElement)getParentElement();
            DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
            TypesElement types = desc.getTypesElement();
            if(types != null) {
                xse = ((TypesImpl)types).getElementDeclaration(fElement.getQName());
            }
        }
        return xse;
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.TypesElement

            ImportElement[] imports = desc.getImportElements();
            for(int i=0; i<imports.length; i++) {
                ImportElement importElem = (ImportElement) imports[i];
                DescriptionElement nestedDesc = importElem.getDescriptionElement();
                if(nestedDesc != null) {
                    TypesElement typesElem = nestedDesc.getTypesElement();
                    if(typesElem != null) {
                        Schema[] schemas = typesElem.getSchemas(schema.getNamespace());
                        for(int j=0; j<schemas.length; j++) {
                            Schema s = (Schema)schemas[i];
                            XmlSchema x = s.getSchemaDefinition();
                            if(x != null) {
                                schemaDef = x;
                                break;
                            }
                        }
                    }
                }
            }
        }
       
        if(schemaDef == null) {
            //Check if any WSDL includes contain a schema with this namespace.
            //TODO there may be multiple schemas that this namespace import could resolve to. This is a temporary solution pending WODEN- post M7.
            IncludeElement[] includes = desc.getIncludeElements();
            for(int i=0; i<includes.length; i++) {
                IncludeElement includeElem = (IncludeElement) includes[i];
                DescriptionElement nestedDesc = includeElem.getDescriptionElement();
                if(nestedDesc != null) {
                    TypesElement typesElem = nestedDesc.getTypesElement();
                    if(typesElem != null) {
                        Schema[] schemas = typesElem.getSchemas(schema.getNamespace());
                        for(int j=0; j<schemas.length; j++) {
                            Schema s = (Schema)schemas[i];
                            XmlSchema x = s.getSchemaDefinition();
                            if(x != null) {
                                schemaDef = x;
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.TypesElement

        // Also, this method currently requires that the schema elements exist in the types element.
        // This may not be the best idea as it may imply that this schema contains an actual import
        // statement in a WSDL 2.0 document. This method also does not work for when building the
        // model programmatically.
        // This method should be reevaluated at a later point.
        TypesElement types = desc.getTypesElement();
        if (types == null) {
            types = desc.addTypesElement();
        }
        if (types.getTypeSystem() == null)
        {
          types.setTypeSystem(Constants.TYPE_XSD_2001);
        }

        try
        {
          Document schemaDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.TypesElement

       
        fBindings = descComp.getBindings();
        fInterfaces = descComp.getInterfaces();
       
        DescriptionElement descElem = descComp.toElement();
        TypesElement types = descElem.getTypesElement()
    fSchemas = types.getSchemas();
    fImportedSchemas = types.getImportedSchemas();
    fInlinedSchemas = types.getInlinedSchemas();
       
        assertEquals("The Description should contain 1 Binding component.", 1, fBindings.length);
        assertEquals("The Description should contain 1 Interface component.", 1, fInterfaces.length);
        assertEquals("The Description should contain 1 imported schema.", 1, fImportedSchemas.length); //the schema for W3C XML Schema imported by the DOM impl
        assertEquals("The Description should contain 1 included (inlined) schema.", 1, fInlinedSchemas.length);
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.TypesElement

       
        fBindings = descComp.getBindings();
        fInterfaces = descComp.getInterfaces();
       
        DescriptionElement descElem = descComp.toElement();
        TypesElement types = descElem.getTypesElement()
    fSchemas = types.getSchemas();
    fImportedSchemas = types.getImportedSchemas();
    fInlinedSchemas = types.getInlinedSchemas();
       
        assertEquals("The Description should contain 1 Binding component.", 1, fBindings.length);
        assertEquals("The Description should contain 1 Interface component.", 1, fInterfaces.length);
        assertEquals("The Description should contain no imported schemas.", 0, fImportedSchemas.length); //Note, the OM impl does not automatically import the schema for W3C XML Schema
        assertEquals("The Description should contain 1 included (inlined) schema.", 1, fInlinedSchemas.length);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.