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; } }
format.setSOAP11(msgContext.isSOAP11()); format.setDoOptimize(msgContext.isDoingMTOM()); format.setDoingSWA(msgContext.isDoingSwA()); format.setCharSetEncoding(TransportUtils.getCharSetEncoding(msgContext));
format.setSOAP11(msgContext.isSOAP11()); format.setDoOptimize(msgContext.isDoingMTOM()); format.setDoingSWA(msgContext.isDoingSwA()); format.setCharSetEncoding(TransportUtils.getCharSetEncoding(msgContext));
/** * 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; }
/** * 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.setDoingSWA(msgContext.isDoingSwA());