Repository: cxf Updated Branches: refs/heads/master 087ae7575 -> 2726b68fa
[CXF-6768]InternalContextUtils should bak all the data from the input stream before send back partialResponse Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2726b68f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2726b68f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2726b68f Branch: refs/heads/master Commit: 2726b68fa3dbc8a98018cc957bef47a23c9a950e Parents: 087ae75 Author: Freeman Fang <[email protected]> Authored: Wed Feb 17 12:03:14 2016 +0800 Committer: Freeman Fang <[email protected]> Committed: Wed Feb 17 12:03:14 2016 +0800 ---------------------------------------------------------------------- .../ws/addressing/impl/InternalContextUtils.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/2726b68f/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java ---------------------------------------------------------------------- diff --git a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java index 2c41925..df06173 100644 --- a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java +++ b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java @@ -268,7 +268,15 @@ final class InternalContextUtils { exchange.put(ConduitSelector.class, new PreexistingConduitSelector(backChannel, exchange.getEndpoint())); - + if (ContextUtils.retrieveAsyncPostResponseDispatch(inMessage) && !robust) { + //need to suck in all the data from the input stream as + //the transport might discard any data on the stream when this + //thread unwinds or when the empty response is sent back + DelegatingInputStream in = inMessage.getContent(DelegatingInputStream.class); + if (in != null) { + in.cacheInput(); + } + } if (chain != null && !chain.doIntercept(partialResponse) && partialResponse.getContent(Exception.class) != null) { if (partialResponse.getContent(Exception.class) instanceof Fault) { @@ -294,14 +302,7 @@ final class InternalContextUtils { if (ContextUtils.retrieveAsyncPostResponseDispatch(inMessage) && !robust) { - //need to suck in all the data from the input stream as - //the transport might discard any data on the stream when this - //thread unwinds or when the empty response is sent back - DelegatingInputStream in = inMessage.getContent(DelegatingInputStream.class); - if (in != null) { - in.cacheInput(); - } - + // async service invocation required *after* a response // has been sent (i.e. to a oneway, or a partial response // to a decoupled twoway)
