Examples of SchemaCollection


Examples of com.thaiopensource.relaxng.edit.SchemaCollection

 
  public static void generateXSDFromDTD(File input, File output) throws Exception {
    ErrorHandlerImpl eh = new ErrorHandlerImpl();
    OutputFormat of = new XsdOutputFormat();
    InputFormat inFormat = new DtdInputFormat();
    SchemaCollection sc = inFormat.load(
        UriOrFile.toUri(input.getAbsolutePath()), new String[0], "xsd", eh);
   
    OutputDirectory od = new LocalOutputDirectory(
        sc.getMainUri(),output,"xml","utf-8",80,4);
   
    of.output(sc, od, new String[0], "xml", eh);
  }
View Full Code Here

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

        listener = new JAXBBindErrorListener(context.isVerbose(), context.getErrorListener());
        schemaCompiler.setErrorListener(listener);
        // Collection<SchemaInfo> schemas = serviceInfo.getSchemas();
        List<InputSource> jaxbBindings = context.getJaxbBindingFile();
        SchemaCollection schemas = (SchemaCollection) context.get(ToolConstants.XML_SCHEMA_COLLECTION);


        List<String> args = new ArrayList<String>();

        if (context.get(ToolConstants.CFG_NO_ADDRESS_BINDING) == null) {
View Full Code Here

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

            org.apache.cxf.common.i18n.Message message
                = new org.apache.cxf.common.i18n.Message("WRAPPED_RULE_1", LOG, opInfo.getName());
            LOG.log(logLevel, message.toString());
            return;
        }
        SchemaCollection schemas = opInfo.getInterface().getService().getXmlSchemaCollection();
        XmlSchemaElement inputEl = null;
        XmlSchemaElement outputEl = null;

        // RULE No.2:
        // The input message part refers to a global element declaration whose
        // local name is equal to the operation name.
        MessagePartInfo inputPart = inputMessage.getMessagePartByIndex(0);
        if (!inputPart.isElement()) {
            passedRule = false;
        } else {
            QName inputElementName = inputPart.getElementQName();
            inputEl = schemas.getElementByQName(inputElementName);
            if (inputEl == null) {
                passedRule = false;
            } else if (!opInfo.getName().getLocalPart().equals(inputElementName.getLocalPart())) {
                passedRule = relaxed;
            }
        }

        if (!passedRule) {
            org.apache.cxf.common.i18n.Message message
                = new org.apache.cxf.common.i18n.Message("WRAPPED_RULE_2", LOG, opInfo.getName());
            LOG.log(logLevel, message.toString());
            return;
        }
        // RULE No.3:
        // The output message part refers to a global element declaration
        MessagePartInfo outputPart = null;
        if (outputMessage != null && outputMessage.size() == 1) {
            outputPart = outputMessage.getMessagePartByIndex(0);
            if (outputPart != null) {
                if (!outputPart.isElement()
                    || schemas.getElementByQName(outputPart.getElementQName()) == null) {
                    passedRule = false;
                } else {
                    outputEl = schemas.getElementByQName(outputPart.getElementQName());
                }
            }
        }

        if (!passedRule) {
View Full Code Here

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

        return ret;
    }
       
       
    private void buildMessage(AbstractMessageContainer minfo, Message msg) {
        SchemaCollection schemas = minfo.getOperation().getInterface().getService()
            .getXmlSchemaCollection();
        List<?> orderedParam = msg.getOrderedParts(null);
        for (Part part : cast(orderedParam, Part.class)) {
            MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(), part
                .getName()));
            if (part.getTypeName() != null) {
                pi.setTypeQName(part.getTypeName());
                pi.setElement(false);
                pi.setXmlSchema(schemas.getTypeByQName(part.getTypeName()));
            } else if (part.getElementName() != null) {
                pi.setElementQName(part.getElementName());
                XmlSchemaElement schemaElement = schemas.getElementByQName(part.getElementName());
                if (null == schemaElement) {
                    org.apache.cxf.common.i18n.Message errorMessage =
                        new org.apache.cxf.common.i18n.Message("WSDL4J_BAD_ELEMENT_PART",
                                                               LOG,
                                                               part.getName(),
View Full Code Here

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
                justCheckForJAXBAnnotations(serviceInfo);
                continue;
            }
View Full Code Here

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

    public SchemaUtil(final Bus b, final Map<String, Element> s) {
        this.bus = b;
        this.schemaList = s;
    }
    public void getSchemas(final Definition def, final ServiceInfo serviceInfo) {
        SchemaCollection schemaCol = serviceInfo.getXmlSchemaCollection();
        getSchemas(def, schemaCol, serviceInfo);
    }
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) {
                QName qn = header.getMessage();
               
                javax.wsdl.Message msg = findMessage(qn, def);
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());
            }
           
           
            OutputStreamCreator outputStreamCreator = null;
            if (context.get(OutputStreamCreator.class) != null) {
                outputStreamCreator = context.get(OutputStreamCreator.class);
            } else {
                outputStreamCreator = new OutputStreamCreator();
                context.put(OutputStreamCreator.class, outputStreamCreator);
            }
            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

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

        ClientImpl client = new ClientImpl(bus, svc, port,
                                           getEndpointImplFactory());

        //all SI's should have the same schemas
        SchemaCollection schemas = svc.getServiceInfos().get(0).getXmlSchemaCollection();

        SchemaCompiler compiler = createSchemaCompiler();
       
        InnerErrorListener listener = new InnerErrorListener(wsdlUrl);
        Object elForRun = ReflectionInvokationHandler
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.