Package javax.wsdl.extensions.schema

Examples of javax.wsdl.extensions.schema.SchemaImport


            }
            if (schema.getImports() != null && schema.getImports().values() != null) {
                for (Object o : schema.getImports().values()) {
                    for (Object oi : (Vector) o) {
                        if (oi instanceof SchemaImport) {
                            SchemaImport imp = ((SchemaImport) oi);
                            Schema importedSchema = imp.getReferencedSchema();
                            if (importedSchema == null) {
                                continue;
                            }
                            String fileNameChild = normalizeName(imp.getSchemaLocationURI());
                            changedSchemaLocations.put(imp.getSchemaLocationURI(), fileNameChild);
                            processSchema(definition, importedSchema, fileNameChild, changedSchemaLocations);
                        }
                    }
                }
            }
View Full Code Here


        Map map = schema.getImports();
        Collection collection = map.values();
        for (Iterator i = collection.iterator(); i.hasNext();) {
            Vector value = (Vector)i.next();
            for (Object vectorObj : value) {
                SchemaImport si = (SchemaImport)vectorObj;
                importList.add(si);
                if (log.isDebugEnabled()) {
                    if (si != null)
                        log.debug(
                                "Reading import for SchemaLocation =" + si.getSchemaLocationURI());
                }
            }
        }

        //Get namespace and flag the schema as read
View Full Code Here

        while (importListIterator.hasNext()) {
            List importList = (List)importListIterator.next();
            Iterator importIterator = importList.iterator();

            while (importIterator.hasNext()) {
                SchemaImport schemaImport = (SchemaImport)importIterator.next();
                pw.println();
                indent(pw, indentCount + 2);
                pw.print("<" + tagName);
                DOMUtils.printAttribute(Constants.ATTR_NAMESPACE,
                                        schemaImport.getNamespaceURI(), pw);
                DOMUtils.printAttribute("schemaLocation",
                                        schemaImport.getSchemaLocationURI(), pw);
                pw.println("/>");
            }
        }
        indent(pw, indentCount);
        pw.print("</xsd:" + schemaName.getLocalPart() + ">");
View Full Code Here

        types.addExtensibilityElement(wsdlSchema);
    }

    private void addWSDLSchemaImport(Schema wsdlSchema, String tns, File file) {
        if (!wsdlSchema.getImports().containsKey(tns)) {
            SchemaImport schemaimport =  wsdlSchema.createImport();
            schemaimport.setNamespaceURI(tns);
            if (file != null
                && !ignoreImports) {
                schemaimport.setSchemaLocationURI(file.toURI().toString());
            }
            wsdlSchema.addImport(schemaimport);
        }
    }
View Full Code Here

        wsdlSchema.setElement(el);
       
        XmlSchemaObjectCollection imports = schema.getIncludes();
        for (java.util.Iterator<XmlSchemaObject> it = CastUtils.cast(imports.getIterator()); it.hasNext();) {
            XmlSchemaImport xmlSchemaImport = (XmlSchemaImport) it.next();
            SchemaImport schemaimport =  wsdlSchema.createImport();
            schemaimport.setNamespaceURI(xmlSchemaImport.getNamespace());
            if (xmlSchemaImport.getSchemaLocation() != null
                && !ignoreImports) {
                schemaimport.setSchemaLocationURI(xmlSchemaImport.getSchemaLocation());
            }
            wsdlSchema.addImport(schemaimport)
        }
        types.addExtensibilityElement(wsdlSchema);
    }
View Full Code Here

        Map map = schema.getImports();
        Collection collection = map.values();
        for (Iterator i = collection.iterator(); i.hasNext();) {
            Vector value = (Vector)i.next();
            for (Object vectorObj : value) {
                SchemaImport si = (SchemaImport)vectorObj;
                importList.add(si);
                if (log.isDebugEnabled()) {
                    if (si != null)
                        log.debug(
                                "Reading import for SchemaLocation =" + si.getSchemaLocationURI());
                }
            }
        }

        //Get namespace and flag the schema as read
View Full Code Here

                           
                            // build up the ws-addressing schema import
                            Schema wsdlSchema =
                                (Schema)def.getExtensionRegistry().createExtension(Types.class,
                                                     new QName(Constants.URI_2001_SCHEMA_XSD, "schema"));
                            SchemaImport schemaimport =  wsdlSchema.createImport();
                            schemaimport.setNamespaceURI(ReferenceConstants.WSADDRESSING_NAMESPACE);
                            schemaimport.setSchemaLocationURI(ReferenceConstants.WSADDRESSING_LOCATION);
                            wsdlSchema.addImport(schemaimport);
                           
                            // add the import and the prefix to the definition
                            def.getTypes().addExtensibilityElement(wsdlSchema);
                            CastUtils.cast(def.getNamespaces(), String.class, String.class)
View Full Code Here

            for (XmlSchemaExternal ext : schemaInfo.getSchema().getExternals()) {
                if (ext.getSchema() == null) {
                    continue;
                }
                if (ext instanceof XmlSchemaImport) {
                    SchemaImport imp = schemaImpl.createImport();
                    imp.setNamespaceURI(((XmlSchemaImport)ext).getNamespace());
                    imp.setSchemaLocationURI(((XmlSchemaImport)ext).getSchemaLocation());
                   
                    Schema schemaImpl2 = getSchemaImplementation(def);
                    schemaImpl2.setRequired(true);
                    schemaImpl2.setElementType(WSDLConstants.QNAME_SCHEMA);
                    schemaImpl2.setDocumentBaseURI(ext.getSchema().getSourceURI());
                    try {
                        schemaImpl2.setElement(ext.getSchema().getSchemaDocument().getDocumentElement());
                    } catch (XmlSchemaSerializerException e) {
                        //ignore
                    }
                    imp.setReferencedSchema(schemaImpl2);

                    schemaImpl.addImport(imp);
                } else if (ext instanceof XmlSchemaInclude) {
                    SchemaReference imp = schemaImpl.createInclude();
                    imp.setSchemaLocationURI(((XmlSchemaInclude)ext).getSchemaLocation());

                    Schema schemaImpl2 = getSchemaImplementation(def);
                    schemaImpl2.setRequired(true);
                    schemaImpl2.setElementType(WSDLConstants.QNAME_SCHEMA);
                    schemaImpl2.setDocumentBaseURI(ext.getSchema().getSourceURI());
                    try {
                        schemaImpl2.setElement(ext.getSchema().getSchemaDocument().getDocumentElement());
                    } catch (XmlSchemaSerializerException e) {
                        //ignore
                    }
                    imp.setReferencedSchema(schemaImpl2);
                   
                    schemaImpl.addInclude(imp);
                } else if (ext instanceof XmlSchemaRedefine) {
                    SchemaReference imp = schemaImpl.createRedefine();
                    imp.setSchemaLocationURI(((XmlSchemaRedefine)ext).getSchemaLocation());
                   
                    Schema schemaImpl2 = getSchemaImplementation(def);
                    schemaImpl2.setRequired(true);
                    schemaImpl2.setElementType(WSDLConstants.QNAME_SCHEMA);
                    schemaImpl2.setDocumentBaseURI(ext.getSchema().getSourceURI());
                    try {
                        schemaImpl2.setElement(ext.getSchema().getSchemaDocument().getDocumentElement());
                    } catch (XmlSchemaSerializerException e) {
                        //ignore
                    }
                    imp.setReferencedSchema(schemaImpl2);
                   
                    schemaImpl.addRedefine(imp);
                }
            }
            types.addExtensibilityElement(schemaImpl);
View Full Code Here

        def.setTypes(types);
    }

    private void addSchemaImport(Schema schema, SchemaInfo schemaInfo, Schema referencedSchema) {
        SchemaImport imp = schema.createImport();
        imp.setId(schemaInfo.getSystemId());
        imp.setNamespaceURI(schemaInfo.getNamespaceURI());
        imp.setSchemaLocationURI(referencedSchema.getDocumentBaseURI());
        imp.setReferencedSchema(referencedSchema);
        schema.addImport(imp);
    }
View Full Code Here

                           
                            // build up the ws-addressing schema import
                            Schema wsdlSchema =
                                (Schema)def.getExtensionRegistry().createExtension(Types.class,
                                                     new QName(Constants.URI_2001_SCHEMA_XSD, "schema"));
                            SchemaImport schemaimport =  wsdlSchema.createImport();
                            schemaimport.setNamespaceURI(ReferenceConstants.WSADDRESSING_NAMESPACE);
                            schemaimport.setSchemaLocationURI(ReferenceConstants.WSADDRESSING_LOCATION);
                            wsdlSchema.addImport(schemaimport);
                           
                            // add the import and the prefix to the definition
                            def.getTypes().addExtensibilityElement(wsdlSchema);
                            CastUtils.cast(def.getNamespaces(), String.class, String.class)
View Full Code Here

TOP

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

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.