Description
If we use decoupled ws-addressing and async invaction handler, client side will hang from time to time. At the same time we can see some error like "Connection reset by peer".
The fix is in HTTPConduit, we should cache the InputStream of inMessage before invoke the clientImpl.onMessage, since for async mode, the onMessage is in anonther thead and executing by executor, we can't guarantee the connection still alive when onMessage really invoked.
So we need do like
InputStream in = inMessage.getContent(InputStream.class);
CachedOutputStream cos = new CachedOutputStream();
IOUtils.copy(in, cos);
inMessage.setContent(InputStream.class, cos.getInputStream());
incomingObserver.onMessage(inMessage);
to cache the inputstream to ensure it's still there when we use it.