Examples of SchemaCollection


Examples of org.apache.cxf.common.xmlschema.SchemaCollection

            LOG.log(Level.FINE, "CREATED_JAXB_CONTEXT", new Object[] {ctx, contextClasses});
        }
        setContext(ctx);

        for (ServiceInfo serviceInfo : service.getServiceInfos()) {
            SchemaCollection col = serviceInfo.getXmlSchemaCollection();

            if (col.getXmlSchemas().length > 1) {
                // someone has already filled in the types
                continue;
            }

            boolean schemasFromCache = false;
View Full Code Here

Examples of org.apache.cxf.common.xmlschema.SchemaCollection

        ServiceInfo serviceInfo = bop.getBinding().getService();

        if (header != null && serviceInfo.getMessage(header.getMessage()) == null) {
            Definition def = (Definition)serviceInfo.getProperty(WSDLServiceBuilder.WSDL_DEFINITION);
            SchemaCollection schemas = serviceInfo.getXmlSchemaCollection();

            if (def != null && schemas != null) {
                javax.wsdl.Message msg = def.getMessage(header.getMessage());
                if (msg != null) {
                    addOutOfBandParts(bop, msg, schemas, isInput, header.getPart());
View Full Code Here

Examples of org.apache.cxf.common.xmlschema.SchemaCollection

   
    private SchemaCollection getSchemaCollection(JAXBContext context) {
        if (context == null) {
            return null;
        }
        SchemaCollection xmlSchemaCollection = new SchemaCollection();
        Collection<DOMSource> schemas = new HashSet<DOMSource>();
        try {
            for (DOMResult r : JAXBUtils.generateJaxbSchemas(context,
                                    CastUtils.cast(Collections.emptyMap(), String.class, DOMResult.class))) {
                schemas.add(new DOMSource(r.getNode(), r.getSystemId()));
View Full Code Here

Examples of org.apache.cxf.common.xmlschema.SchemaCollection

        if (externalSchemaLinks != null && externalSchemasCache == null) {
            return new ExternalSchemaWriter(externalSchemaLinks, ui);
        } else if (externalSchemasCache != null) {
            return new StringSchemaWriter(externalSchemasCache, externalSchemaLinks, ui);
        } else if (context != null) {
            SchemaCollection coll = getSchemaCollection(context);
            if (coll != null) {
                return new SchemaCollectionWriter(coll);
            }
        }
        return null;
View Full Code Here

Examples of org.apache.cxf.common.xmlschema.SchemaCollection

     * through the collection, that's what it is for.
     */
    private void fillInSchemaCrossreferences() {
        Service service = getService();
        for (ServiceInfo serviceInfo : service.getServiceInfos()) {
            SchemaCollection schemaCollection = serviceInfo.getXmlSchemaCollection();

            // First pass, fill in any types for which we have a name but no
            // type.
            for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
                XmlSchemaObjectTable elementsTable = schemaInfo.getSchema().getElements();
                Iterator elementsIterator = elementsTable.getNames();
                while (elementsIterator.hasNext()) {
                    QName elementName = (QName)elementsIterator.next();
                    XmlSchemaElement element = schemaInfo.getSchema().getElementByName(elementName);
                    if (element.getSchemaType() == null) {
                        QName typeName = element.getSchemaTypeName();
                        if (typeName != null) {
                            XmlSchemaType type = schemaCollection.getTypeByQName(typeName);
                            if (type == null) {
                                Message message = new Message("REFERENCE_TO_UNDEFINED_TYPE", LOG, element
                                    .getQName(), typeName, service.getName());
                                LOG.severe(message.toString());
                            } else {
View Full Code Here

Examples of org.apache.cxf.common.xmlschema.SchemaCollection

        if (Proxy.isProxyClass(this.getServiceClass())) {
            LOG.log(Level.WARNING, "USING_PROXY_FOR_SERVICE", getServiceClass());
        }
        ServiceInfo serviceInfo = new ServiceInfo();
        SchemaCollection col = serviceInfo.getXmlSchemaCollection();
        col.getXmlSchemaCollection().setSchemaResolver(new CatalogXmlSchemaURIResolver(this.getBus()));
        col.getExtReg().registerSerializer(MimeAttribute.class, new MimeSerializer());

        ServiceImpl service = new ServiceImpl(serviceInfo);
        setService(service);

        setServiceProperties();
View Full Code Here

Examples of org.apache.cxf.common.xmlschema.SchemaCollection

                return s;
            }
        }

        SchemaInfo schemaInfo = new SchemaInfo(namespaceURI);
        SchemaCollection col = serviceInfo.getXmlSchemaCollection();
        XmlSchema schema = col.getSchemaByTargetNamespace(namespaceURI);

        if (schema != null) {
            schemaInfo.setSchema(schema);
            serviceInfo.addSchema(schemaInfo);
            return schemaInfo;
        }

        schema = col.newXmlSchemaInCollection(namespaceURI);
        if (qualified) {
            schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
        }
        schemaInfo.setSchema(schema);
View Full Code Here

Examples of org.apache.cxf.common.xmlschema.SchemaCollection

          
        JAXBBindErrorListener listener = new JAXBBindErrorListener(context.isVerbose());
        schemaCompiler.setErrorListener(listener);
        // Collection<SchemaInfo> schemas = serviceInfo.getSchemas();
        List<InputSource> jaxbBindings = context.getJaxbBindingFile();
        SchemaCollection schemas = (SchemaCollection) context.get(ToolConstants.XML_SCHEMA_COLLECTION);
       
        Options opts = null;
        opts = getOptions(schemaCompiler);
       
        List<String> args = new ArrayList<String>();
View Full Code Here

Examples of org.apache.cxf.common.xmlschema.SchemaCollection

        context.put(ToolConstants.SERVICE_LIST, serviceList);
       
        Map<String, InterfaceInfo> interfaces = new LinkedHashMap<String, InterfaceInfo>();

        ServiceInfo service0 = serviceList.get(0);
        SchemaCollection schemaCollection = service0.getXmlSchemaCollection();
        context.put(ToolConstants.XML_SCHEMA_COLLECTION, schemaCollection);
       
        context.put(ToolConstants.PORTTYPE_MAP, interfaces);
       
        context.put(ClassCollector.class, createClassCollector());
View Full Code Here

Examples of org.apache.cxf.common.xmlschema.SchemaCollection

        File wsdlFile = new File(outputdir, (String)context.get(ToolConstants.CFG_WSDLLOCATION));
        Definition def = context.get(Definition.class);
        try {
            //get imported schemas
            int xsdCount = 0;
            SchemaCollection schemas = (SchemaCollection) context.get(ToolConstants.XML_SCHEMA_COLLECTION);
            Map<String, String> sourceMap = new HashMap<String, String>();
            for (XmlSchema imp : schemas.getXmlSchemas()) {
                if (imp.getSourceURI() != null && !imp.getSourceURI().contains(".wsdl#")) {
                    String schemaFileName = "schema" + (++xsdCount) + ".xsd";
                    sourceMap.put(imp.getTargetNamespace(), schemaFileName);
                }
            }
          
            //get imported wsdls
            List<Definition> defs = (List<Definition>)context.get(ToolConstants.IMPORTED_DEFINITION);           
            Map<String, String> importWSDLMap = new HashMap<String, String>();
            for (Definition importDef : defs) {
                File importedWsdlFile = null;
                if (!StringUtils.isEmpty(importDef.getDocumentBaseURI())) {
                    importedWsdlFile = new File(importDef.getDocumentBaseURI());
                } else {
                    importedWsdlFile = new File(importDef.getQName().getLocalPart() + ".wsdl");
                }
                importWSDLMap.put(importDef.getTargetNamespace(), importedWsdlFile.getName());
            }
           
           
            Writer os = null;
            for (XmlSchema imp : schemas.getXmlSchemas()) {
                if (imp.getSourceURI() != null && !imp.getSourceURI().contains(".wsdl#")) {
                    String schemaFileName = sourceMap.get(imp.getTargetNamespace());
                    File impfile = new File(wsdlFile.getParentFile(), schemaFileName);
                    Element el = imp.getSchemaDocument().getDocumentElement();
                    updateImports(el, sourceMap);
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.