Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.serializeAndConsume()


            if (!(format.isOptimized()) & format.isDoingSWA()) {
                StringWriter bufferedSOAPBody = new StringWriter();
                if (preserve) {
                    element.serialize(bufferedSOAPBody, format);
                } else {
                    element.serializeAndConsume(bufferedSOAPBody, format);
                }
                writeSwAMessage(msgCtxt, bufferedSOAPBody, out, format);
            } else {
                if (preserve) {
                    element.serialize(out, format);
View Full Code Here


                writeSwAMessage(msgCtxt, bufferedSOAPBody, out, format);
            } else {
                if (preserve) {
                    element.serialize(out, format);
                } else {
                    element.serializeAndConsume(out, format);
                }
            }
        } catch (XMLStreamException e) {
            throw AxisFault.makeFault(e);
        } finally {
View Full Code Here

                if (format.isDoingSWA()) {
                    // Why are we creating a new OMOutputFormat
                    OMOutputFormat format2 = new OMOutputFormat();
                    format2.setCharSetEncoding(format.getCharSetEncoding());
                    StringWriter bufferedSOAPBody = new StringWriter();
                    element.serializeAndConsume(bufferedSOAPBody, format2);
                    writeSwAMessage(msgCtxt, bufferedSOAPBody, bytesOut, format);
                } else {
                    element.serializeAndConsume(bytesOut, format);
                }
                return bytesOut.toByteArray();
View Full Code Here

                    format2.setCharSetEncoding(format.getCharSetEncoding());
                    StringWriter bufferedSOAPBody = new StringWriter();
                    element.serializeAndConsume(bufferedSOAPBody, format2);
                    writeSwAMessage(msgCtxt, bufferedSOAPBody, bytesOut, format);
                } else {
                    element.serializeAndConsume(bytesOut, format);
                }
                return bytesOut.toByteArray();
            } else {
                element.serializeAndConsume(bytesOut, format);
                return bytesOut.toByteArray();
View Full Code Here

                } else {
                    element.serializeAndConsume(bytesOut, format);
                }
                return bytesOut.toByteArray();
            } else {
                element.serializeAndConsume(bytesOut, format);
                return bytesOut.toByteArray();
            }
        } catch (XMLStreamException e) {
            throw AxisFault.makeFault(e);
        } catch (FactoryConfigurationError e) {
View Full Code Here

            ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();

            if (omElement != null) {

                try {
                    omElement.serializeAndConsume(bytesOut, format);
                } catch (XMLStreamException e) {
                    throw AxisFault.makeFault(e);
                }

                return bytesOut.toByteArray();
View Full Code Here

            } else {
                omElement = messageContext.getEnvelope().getBody().getFirstElement();
            }
            if (omElement != null) {
                try {
                    omElement.serializeAndConsume(outputStream, format);
                } catch (XMLStreamException e) {
                    throw AxisFault.makeFault(e);
                }
            }
            try {
View Full Code Here

        if (contentType == SPINE) {
            getContentAsXMLSpine().outputTo(writer, consume);
        } else {
            OMElement omElement = getContentAsOMElement();
            if (consume) {
                omElement.serializeAndConsume(writer);
            } else {
                omElement.serialize(writer);
            }
        }
        setConsumed(consume);
View Full Code Here

        OMOutputFormat format = new OMOutputFormat();
        format.setDoOptimize(true);
        format.setSOAP11(true);
              
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        payload.serializeAndConsume(baos, format);

        TestLogger.logger.debug("==================================");
        TestLogger.logger.debug(baos.toString());
        TestLogger.logger.debug("==================================");
    }
View Full Code Here

    public void testFailureAtServerRequestFlow() throws Exception {
        try {
            ServiceClient sender = getClient(Echo.SERVICE_NAME, Echo.ECHO_OM_ELEMENT_OP_NAME);
           
            OMElement result = sender.sendReceive(TestingUtils.createDummyOMElement());
            result.serializeAndConsume(StAXUtils.createXMLStreamWriter(System.out));
            fail("the test must fail due to the intentional failure of the \"culprit\" handler");
        } catch (AxisFault e) {
            log.info(e.getMessage());
            String message = e.getMessage();
            assertTrue((message.indexOf(UtilServer.FAILURE_MESSAGE)) >= 0);
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.