Only disable output stream optimization in TransformOutInterceptor if it isn't configured already
@@ -98,8 +98,10 @@ public class TransformOutInterceptor extends AbstractPhaseInterceptor<Message> {
XMLStreamWriter transformWriter = createTransformWriterIfNeeded(writer, out);
if (transformWriter != null) {
message.setContent(XMLStreamWriter.class, transformWriter);
+ if (message.getContextualProperty(AbstractOutDatabindingInterceptor.DISABLE_OUTPUTSTREAM_OPTIMIZATION) == null) {
message.put(AbstractOutDatabindingInterceptor.DISABLE_OUTPUTSTREAM_OPTIMIZATION,
Boolean.TRUE);
+ }
if (MessageUtils.isRequestor(message)) {
message.removeContent(OutputStream.class);
message.put(OUTPUT_STREAM_HOLDER, out);
