Package javax.wsdl.extensions.schema

Examples of javax.wsdl.extensions.schema.Schema


       
        Collection<List> imports = schema.getImports().values();
        for (List list : imports) {
            List<SchemaImport> impList = list;
            for (SchemaImport imp : impList) {
                Schema importedSchema = imp.getReferencedSchema();
                if (importedSchema == null) {
                    continue;
                }
                boolean rs = checkForElement(importedSchema);
                if (rs) {
View Full Code Here


        if (types != null) {
            List schemas = types.getExtensibilityElements();
            for (Iterator iterator = schemas.iterator(); iterator.hasNext();) {
                Object o = iterator.next();
                if (o instanceof Schema) {
                    Schema unknownExtensibilityElement = (Schema) o;
                    QName elementType = unknownExtensibilityElement.getElementType();
                    if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) {
                        Element element = unknownExtensibilityElement.getElement();
                        addSchemaElement(element, namespaceMap, schemaList);
                    }
                } else if (o instanceof UnknownExtensibilityElement) {
                    //This is allegedly obsolete as of axis-wsdl4j-1.2-RC3.jar which includes the Schema extension above.
                    //The change notes imply that imported schemas should end up in Schema elements.  They don't, so this is still needed.
                    UnknownExtensibilityElement unknownExtensibilityElement = (UnknownExtensibilityElement) o;
                    Element element = unknownExtensibilityElement.getElement();
                    String elementNamespace = element.getNamespaceURI();
                    String elementLocalName = element.getNodeName();
                    if ("http://www.w3.org/2001/XMLSchema".equals(elementNamespace) && "schema".equals(elementLocalName)) {
                        addSchemaElement(element, namespaceMap, schemaList);
                    }
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el : (List<ExtensibilityElement>)types.getExtensibilityElements()) {
                if (el instanceof Schema) {
                    Schema schema = (Schema)el;
                    updateSchemaImports(parentDocKey, schema, docMap, base);
                }
            }
        }
    }
View Full Code Here

                                       String base) {
        @SuppressWarnings("unchecked")
        Collection<List<SchemaImport>> imports = schema.getImports().values();
        for (List<SchemaImport> impList : imports) {
            for (SchemaImport s : impList) {
                Schema importedSchema = s.getReferencedSchema();
                if (importedSchema == null) {
                    continue;
                }
                String docURI = importedSchema.getDocumentBaseURI();
                String location = s.getSchemaLocationURI();
                String importId = parentDocKey + "/" + location;
                String docKey = docMap.get(docURI);
                if (docKey == null) {
                    docKey = getUniqueSchemaId();
                    docMap.put(docURI, docKey);
                    schemaMap.put(docKey, s);
                    updateSchemaImports(docKey, importedSchema, docMap, base);
                }
                importMap.put(importId, docKey);
            }
        }

        @SuppressWarnings("unchecked")
        List<SchemaReference> includes = schema.getIncludes();
        for (SchemaReference s : includes) {
            Schema includedSchema = s.getReferencedSchema();
            if (includedSchema == null) {
                continue;
            }
            String docURI = includedSchema.getDocumentBaseURI();
            String location = s.getSchemaLocationURI();
            String importId = parentDocKey + "/" + location;
            String docKey = docMap.get(docURI);
            if (docKey == null) {
                docKey = getUniqueSchemaId();
View Full Code Here

        Types types = definition.getTypes();
        Assert.assertNotNull("No types created", types);
        Assert.assertEquals("Invalid amount of schemas", 1, types.getExtensibilityElements().size());

        Schema wsdlSchema = (Schema) types.getExtensibilityElements().get(0);
        Assert.assertNotNull("No element defined", wsdlSchema.getElement());
    }
View Full Code Here

        Types types = definition.getTypes();
        Assert.assertNotNull("No types created", types);
        Assert.assertEquals("Invalid amount of schemas", 2, types.getExtensibilityElements().size());

        Schema wsdlSchema = (Schema) types.getExtensibilityElements().get(0);
        Assert.assertNotNull("No element defined", wsdlSchema.getElement());

        wsdlSchema = (Schema) types.getExtensibilityElements().get(1);
        Assert.assertNotNull("No element defined", wsdlSchema.getElement());
    }
View Full Code Here

        Resource resource = new ClassPathResource("schema.xsd", getClass());
        Document schemaDocument = documentBuilder.parse(SaxUtils.createInputSource(resource));
        Types types = definition.createTypes();
        definition.setTypes(types);
        Schema schema = (Schema) definition.getExtensionRegistry()
                .createExtension(Types.class, new QName("http://www.w3.org/2001/XMLSchema", "schema"));
        types.addExtensibilityElement(schema);
        schema.setElement(schemaDocument.getDocumentElement());

        provider.addMessages(definition);

        Assert.assertEquals("Invalid amount of messages created", 3, definition.getMessages().size());
View Full Code Here

        Resource resource = new ClassPathResource("schema.xsd", getClass());
        Document schemaDocument = documentBuilder.parse(SaxUtils.createInputSource(resource));
        Types types = definition.createTypes();
        definition.setTypes(types);
        Schema schema = (Schema) definition.getExtensionRegistry()
                .createExtension(Types.class, new QName("http://www.w3.org/2001/XMLSchema", "schema"));
        types.addExtensibilityElement(schema);
        schema.setElement(schemaDocument.getDocumentElement());

        provider.addMessages(definition);

        Assert.assertEquals("Invalid amount of messages created", 2, definition.getMessages().size());
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el
                : CastUtils.cast((List)types.getExtensibilityElements(), ExtensibilityElement.class)) {
                if (el instanceof Schema) {
                    Schema see = (Schema)el;
                    updateSchemaImports(see, doneSchemas, base);
                }
            }
        }
    }   
View Full Code Here

        if (typesElement != null) {
            int schemaCount = 1;
            for (Object obj : typesElement.getExtensibilityElements()) {
                org.w3c.dom.Element schemaElem = null;
                if (obj instanceof Schema) {
                    Schema schema = (Schema)obj;
                    schemaElem = schema.getElement();
                } else if (obj instanceof UnknownExtensibilityElement) {
                    org.w3c.dom.Element elem = ((UnknownExtensibilityElement)obj).getElement();
                    if (elem.getLocalName().equals("schema")) {
                        schemaElem = elem;
                    }
View Full Code Here

TOP

Related Classes of javax.wsdl.extensions.schema.Schema

Copyright © 2018 www.massapicom. 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.