//we need to keep the LoggingOutputInterceptor
Interceptor<? extends Message> loggingOutputInterceptor = getLoggingOutInterceptor(client);
removeInterceptorWhichIsOutThePhases(client.getOutInterceptors(), REMAINING_OUT_PHASES);
removeInterceptorWhichIsOutThePhases(client.getEndpoint().getOutInterceptors(), REMAINING_OUT_PHASES);
client.getEndpoint().getBinding().getOutInterceptors().clear();
client.getEndpoint().getOutInterceptors().add(new RawMessageContentRedirectInterceptor());
if (loggingOutputInterceptor != null) {
client.getEndpoint().getOutInterceptors().add(loggingOutputInterceptor);
}
}