public void setDoOptimize(boolean b) { format.setDoOptimize(b); }
private void handleOMOutput(OutputStream out, boolean doingMTOM) throws XMLStreamException { format.setDoOptimize(doingMTOM); element.serializeAndConsume(out, format); }
/** * Writes the om to a log.debug. * This method assumes optimized mtom attachments * Also calculates the length of the message. * @param om OMElement * @param log Log * @param limit limit of message to write * @return length of entire message */ public static long logDebug(OMElement om, Log log, int limit) { OMOutputFormat format = new OMOutputFormat(); format.setDoOptimize(true); format.setIgnoreXMLDeclaration(true); return logDebug(om, log, limit, format); }
public byte[] writeBytes() throws AxisFault { try { ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); if (!format.isOptimized()) { OMOutputFormat format2 = new OMOutputFormat(); format2.setCharSetEncoding(charSetEnc); element.serializeAndConsume(bytesOut, format2); return bytesOut.toByteArray(); } else { format.setCharSetEncoding(charSetEnc); format.setDoOptimize(true); element.serializeAndConsume(bytesOut, format); return bytesOut.toByteArray(); } } catch (XMLStreamException e) { throw AxisFault.makeFault(e); } catch (FactoryConfigurationError e) { throw AxisFault.makeFault(e); } }
public static void writeMessage(MessageContext msgContext, OutputStream out) throws AxisFault { SOAPEnvelope envelope = msgContext.getEnvelope(); OMElement outputMessage = envelope; if ((envelope != null) && msgContext.isDoingREST()) { outputMessage = envelope.getBody().getFirstElement(); } if (outputMessage != null) { try { OMOutputFormat format = new OMOutputFormat(); // Pick the char set encoding from the msgContext String charSetEnc = (String) msgContext .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING); format.setDoOptimize(false); format.setDoingSWA(false); format.setCharSetEncoding(charSetEnc); outputMessage.serializeAndConsume(out, format); out.flush(); } catch (Exception e) { throw AxisFault.makeFault(e); } } else { throw new AxisFault(Messages.getMessage("outMessageNull")); } }
public static void writeMessage(MessageContext msgContext, OutputStream out) throws AxisFault { SOAPEnvelope envelope = msgContext.getEnvelope(); OMElement outputMessage = envelope; if ((envelope != null) && msgContext.isDoingREST()) { outputMessage = envelope.getBody().getFirstElement(); } if (outputMessage != null) { try { OMOutputFormat format = new OMOutputFormat(); // Pick the char set encoding from the msgContext String charSetEnc = (String) msgContext .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING); format.setDoOptimize(false); format.setDoingSWA(false); format.setCharSetEncoding(charSetEnc); outputMessage.serializeAndConsume(out, format); out.flush(); } catch (Exception e) { throw AxisFault.makeFault(e); } } else { throw new AxisFault(Messages.getMessage("outMessageNull")); } }
private OMOutputFormat getOutputFormat() { if (outputFormat != null) { return outputFormat; } else { String charsetEncoding = axiomMessage.getCharsetEncoding(); OMOutputFormat outputFormat = new OMOutputFormat(); outputFormat.setCharSetEncoding(charsetEncoding); outputFormat.setSOAP11(getVersion() == SoapVersion.SOAP_11); if (isXopPackage()) { outputFormat.setDoOptimize(true); } else if (!attachments.getContentIDSet().isEmpty()) { outputFormat.setDoingSWA(true); } return outputFormat; } }
private OMOutputFormat getOutputFormat() { if (outputFormat != null) { return outputFormat; } else { String charsetEncoding = axiomMessage.getCharsetEncoding(); OMOutputFormat outputFormat = new OMOutputFormat(); outputFormat.setCharSetEncoding(charsetEncoding); outputFormat.setSOAP11(getVersion() == SoapVersion.SOAP_11); if (isXopPackage()) { outputFormat.setDoOptimize(true); } else if (!attachments.getContentIDSet().isEmpty()) { outputFormat.setDoingSWA(true); } return outputFormat; } }
private OMOutputFormat getOutputFormat() { if (outputFormat != null) { return outputFormat; } else { String charsetEncoding = axiomMessage.getCharsetEncoding(); OMOutputFormat outputFormat = new OMOutputFormat(); outputFormat.setCharSetEncoding(charsetEncoding); outputFormat.setSOAP11(getVersion() == SoapVersion.SOAP_11); if (isXopPackage()) { outputFormat.setDoOptimize(true); } else if (!attachments.getContentIDSet().isEmpty()) { outputFormat.setDoingSWA(true); } return outputFormat; } }
private OMOutputFormat getOutputFormat() { if (outputFormat != null) { return outputFormat; } else { String charsetEncoding = axiomMessage.getCharsetEncoding(); OMOutputFormat outputFormat = new OMOutputFormat(); outputFormat.setCharSetEncoding(charsetEncoding); outputFormat.setSOAP11(getVersion() == SoapVersion.SOAP_11); if (isXopPackage()) { outputFormat.setDoOptimize(true); } else if (!attachments.getContentIDSet().isEmpty()) { outputFormat.setDoingSWA(true); } return outputFormat; } }
boolean persistOptimized = getPersistOptimized(); if (persistOptimized) { outputFormat.setDoOptimize(true);
boolean persistOptimized = getPersistOptimized(); if (persistOptimized) { outputFormat.setDoOptimize(true);
msgContext.setDoingREST(TransportUtils.isDoingREST(msgContext)); format.setSOAP11(msgContext.isSOAP11()); format.setDoOptimize(msgContext.isDoingMTOM()); format.setDoingSWA(msgContext.isDoingSwA()); format.setCharSetEncoding(TransportUtils.getCharSetEncoding(msgContext));
msgContext.setDoingREST(TransportUtils.isDoingREST(msgContext)); format.setSOAP11(msgContext.isSOAP11()); format.setDoOptimize(msgContext.isDoingMTOM()); format.setDoingSWA(msgContext.isDoingSwA()); format.setCharSetEncoding(TransportUtils.getCharSetEncoding(msgContext));
/** * Get the OMOutput format for the given message * @param msgContext the axis message context * @return the OMOutput format to be used */ public static OMOutputFormat getOMOutputFormat(MessageContext msgContext) { OMOutputFormat format = new OMOutputFormat(); msgContext.setDoingMTOM(TransportUtils.doWriteMTOM(msgContext)); msgContext.setDoingSwA(TransportUtils.doWriteSwA(msgContext)); msgContext.setDoingREST(TransportUtils.isDoingREST(msgContext)); format.setSOAP11(msgContext.isSOAP11()); format.setDoOptimize(msgContext.isDoingMTOM()); format.setDoingSWA(msgContext.isDoingSwA()); format.setCharSetEncoding(TransportUtils.getCharSetEncoding(msgContext)); Object mimeBoundaryProperty = msgContext.getProperty(Constants.Configuration.MIME_BOUNDARY); if (mimeBoundaryProperty != null) { format.setMimeBoundary((String) mimeBoundaryProperty); } return format; }
/** * Retirn the OMOutputFormat to be used for the message context passed in * @param msgContext the message context * @return the OMOutputFormat to be used */ public static OMOutputFormat getOMOutputFormat(MessageContext msgContext) { OMOutputFormat format = new OMOutputFormat(); msgContext.setDoingMTOM(TransportUtils.doWriteMTOM(msgContext)); msgContext.setDoingSwA(TransportUtils.doWriteSwA(msgContext)); msgContext.setDoingREST(TransportUtils.isDoingREST(msgContext)); format.setSOAP11(msgContext.isSOAP11()); format.setDoOptimize(msgContext.isDoingMTOM()); format.setDoingSWA(msgContext.isDoingSwA()); format.setCharSetEncoding(TransportUtils.getCharSetEncoding(msgContext)); Object mimeBoundaryProperty = msgContext.getProperty(Constants.Configuration.MIME_BOUNDARY); if (mimeBoundaryProperty != null) { format.setMimeBoundary((String) mimeBoundaryProperty); } return format; }
/** * Get the OMOutput format for the given message * @param msgContext the axis message context * @return the OMOutput format to be used */ public static OMOutputFormat getOMOutputFormat(MessageContext msgContext) { OMOutputFormat format = new OMOutputFormat(); msgContext.setDoingMTOM(TransportUtils.doWriteMTOM(msgContext)); msgContext.setDoingSwA(TransportUtils.doWriteSwA(msgContext)); msgContext.setDoingREST(TransportUtils.isDoingREST(msgContext)); format.setSOAP11(msgContext.isSOAP11()); format.setDoOptimize(msgContext.isDoingMTOM()); format.setDoingSWA(msgContext.isDoingSwA()); format.setCharSetEncoding(TransportUtils.getCharSetEncoding(msgContext)); Object mimeBoundaryProperty = msgContext.getProperty(Constants.Configuration.MIME_BOUNDARY); if (mimeBoundaryProperty != null) { format.setMimeBoundary((String) mimeBoundaryProperty); } return format; }
format.setDoOptimize(msgContext.isDoingMTOM()); format.setDoingSWA(msgContext.isDoingSwA());