[CXF-8633]http.responseMessage gets lost in AbstractClient#setResponseBuilder
@@ -102,6 +102,7 @@ import org.apache.cxf.phase.PhaseManager;
import org.apache.cxf.service.Service;
import org.apache.cxf.service.model.BindingOperationInfo;
import org.apache.cxf.transport.MessageObserver;
+import org.apache.cxf.transport.http.HTTPConduit;
/**
* Common proxy and http-centric client implementation
@@ -439,6 +440,12 @@ public abstract class AbstractClient implements Client {
return currentResponseBuilder;
}
+ String reasonPhrase = (String)MessageUtils.getContextualProperty(
+ responseMessage, HTTPConduit.HTTP_RESPONSE_MESSAGE, null);
+ if (reasonPhrase != null) {
+ currentResponseBuilder.status(status, reasonPhrase);
+ }
+
Map<String, List<Object>> protocolHeaders =
CastUtils.cast((Map<?, ?>)responseMessage.get(Message.PROTOCOL_HEADERS));
@@ -486,6 +493,7 @@ public abstract class AbstractClient implements Client {
InputStream mStream = responseMessage.getContent(InputStream.class);
currentResponseBuilder.entity(mStream);
+
return currentResponseBuilder;
}
