Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMOutput


        SOAPEnvelope env = omFactory.getDefaultEnvelope();
        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(omFactory,XMLInputFactory.newInstance().
                createXMLStreamReader(new InputStreamReader(new ByteArrayInputStream(xmlText2.getBytes()))));
        env.getBody().addChild(builder.getDocumentElement());

        OMOutput omOutput =  new OMOutput(System.out,false);
        //env.getBody().addChild(builder.getDocumentElement());
       
        env.serializeWithCache(omOutput);
       // env.serializeWithCache(xmlStreamWriter, true);

        omOutput.flush();

    }
View Full Code Here


    }

    public void testStaxBuilder() throws Exception {
        SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
        assertNotNull(envelope);
        OMOutput omOutput = new OMOutput(new FileOutputStream(tempFile),false);
        //        XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);
        envelope.serializeWithCache(omOutput);


    }
View Full Code Here

    protected void setUp() throws Exception {
        reader = XMLInputFactory.newInstance().
                createXMLStreamReader(new FileReader(getTestResourceFile("soap/soapmessage.xml")));
        tempFile = File.createTempFile("temp", "xml");
        omOutput = new OMOutput(XMLOutputFactory.newInstance().
                createXMLStreamWriter(new FileOutputStream(tempFile)));
        //        writer = XMLOutputFactory.newInstance().
        //                createXMLStreamWriter(System.out);
    }
View Full Code Here

    }

    protected void setUp() throws Exception {
        super.setUp();
        soapEnvelope = (SOAPEnvelope) getOMBuilder("soap/soap11/soap11fault.xml").getDocumentElement();
        omOutput = new OMOutput(XMLOutputFactory.newInstance().
                createXMLStreamWriter(System.out));
    }
View Full Code Here

            if (epr != null) {
                writeMessageWithCommons(msgContext, epr, dataOut);
            } else {
                OutputStream out =
                    (OutputStream) msgContext.getProperty(MessageContext.TRANSPORT_OUT);
                OMOutput output = new OMOutput(out, false);
                dataOut.serialize(output);
            }
            msgContext.getOperationContext().setProperty(
                Constants.RESPONSE_WRITTEN,
                Constants.VALUE_TRUE);
View Full Code Here

        public byte[] writeBytes() throws AxisFault {
            try {
                ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
                XMLStreamWriter outputWriter =
                    XMLOutputFactory.newInstance().createXMLStreamWriter(bytesOut);
                OMOutput output = new OMOutput(outputWriter);
                element.serialize(output);
                outputWriter.flush();
                return bytesOut.toByteArray();
            } catch (XMLStreamException e) {
                throw new AxisFault(e);
View Full Code Here

        public void writeRequest(OutputStream out) throws IOException {
            try {
                if (chuncked) {
                    XMLStreamWriter outputWriter = null;
                    outputWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(out);
                    OMOutput output = new OMOutput(outputWriter);
                    element.serialize(output);
                    outputWriter.flush();
                    out.flush();
                } else {
                    if (bytes == null) {
View Full Code Here

            String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
            msgContext.setProperty(
                    Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    if (HTTPTransportUtils.isRESTRequest(contentTypeStr)) {
                        RESTUtil.processPOSTRequest(msgContext, is, os,
                                request.getRequestLine().getUri(), contentType, builder, isRestDispatching);
                    } else {
View Full Code Here

            String contentTypeStr = contentType != null ?
                    contentType.getValue() : inferContentType();

            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);

                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    RESTUtil.processGetAndDeleteRequest(
                            msgContext, os, request.getRequestLine().getUri(),
                            request.getFirstHeader(HTTP.CONTENT_TYPE), builder,
                            method, isRestDispatching);
                }
View Full Code Here

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.om.OMOutput

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.