Package javax.wsdl.extensions.schema

Examples of javax.wsdl.extensions.schema.SchemaImport


                           
                            // 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


        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);

        for (XmlSchemaExternal ext : schema.getExternals()) {
            if (ext instanceof XmlSchemaImport) {
                XmlSchemaImport xmlSchemaImport = (XmlSchemaImport)ext;
                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

      if (SchemaConstants.XSD_IMPORT_QNAME_LIST.contains(tempElType))
      {
        // Create a new import. Don't use the
        // ExtensionRegistry.createExtension()
        // method as a Schema import is not a WSDL import.
        SchemaImport im = schema.createImport();

        im.setId(DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_ID));
        im.setNamespaceURI(DOMUtils.getAttribute(tempEl, Constants.ATTR_NAMESPACE));

        locationURI = DOMUtils.getAttribute(tempEl, SchemaConstants.ATTR_SCHEMA_LOCATION);
        im.setSchemaLocationURI(locationURI);

        // Now the import is set up except for the point to the
        // referenced LWS, add the import to the LightWeightSchema.
        schema.addImport(im);
      }
View Full Code Here

                        _schemas.read(schema.getElement(), getUri(schema.getDocumentBaseURI()));
                    }
                    for (Iterator itImp = schema.getImports().values().iterator(); itImp.hasNext();) {
                        Collection imps = (Collection) itImp.next();
                        for (Iterator itSi = imps.iterator(); itSi.hasNext();) {
                            SchemaImport imp = (SchemaImport) itSi.next();
                            _schemas.read(imp.getSchemaLocationURI(), getUri(def.getDocumentBaseURI()));
                        }
                    }
                }
            }
        }
        if (def.getImports() != null) {
            for (Iterator itImp = def.getImports().values().iterator(); itImp.hasNext();) {
                Collection imps = (Collection) itImp.next();
                for (Iterator iter = imps.iterator(); iter.hasNext();) {
                    Import imp = (Import) iter.next();
                    parseSchemas(imp.getDefinition());
                }
            }
        }
    }
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);
            } else {
                //imports
                String name = baseFileName + "_schema" + (++xsdCount) + ".xsd";
                Element imp = XMLUtils.createElementNS(doc,
                                                       new QName(WSDLConstants.NS_SCHEMA_XSD,
                                                                  "import"));
                imp.setAttribute("schemaLocation", name);
                imp.setAttribute("namespace", schemaInfo.getNamespaceURI());
                nd.appendChild(imp);
                              
                imports.put(name, schemaInfo);
            }
View Full Code Here

            }
            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

                        schemas.read(schema.getElement(), getUri(schema.getDocumentBaseURI()));
                    }
                    for (Iterator itImp = schema.getImports().values().iterator(); itImp.hasNext();) {
                        Collection imps = (Collection) itImp.next();
                        for (Iterator itSi = imps.iterator(); itSi.hasNext();) {
                            SchemaImport imp = (SchemaImport) itSi.next();
                            schemas.read(imp.getSchemaLocationURI(), getUri(def.getDocumentBaseURI()));
                        }
                    }
                }
            }
        }
        if (def.getImports() != null) {
            for (Iterator itImp = def.getImports().values().iterator(); itImp.hasNext();) {
                Collection imps = (Collection) itImp.next();
                for (Iterator iter = imps.iterator(); iter.hasNext();) {
                    Import imp = (Import) iter.next();
                    parseSchemas(imp.getDefinition());
                }
            }
        }
    }
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

        }
        return doc;
    }

    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

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.