[
https://issues.apache.org/jira/browse/CXF-3288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sergey Beryozkin resolved CXF-3288.
-----------------------------------
Resolution: Fixed
> Multiple Client.getResponse() calls do not work
> -----------------------------------------------
>
> Key: CXF-3288
> URL: https://issues.apache.org/jira/browse/CXF-3288
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.3.2
> Reporter: Sergey Beryozkin
> Assignee: Sergey Beryozkin
> Fix For: 2.4, 2.3.3
>
>
> Calling webClient.getResponse() works only for the first call, subsequent
> calls return an empty Response.
> Internally, the response state is represented by ResponseBuilder which resets
> its state after ResponseBuilder.build() as required by the java docs. Hence
> only the first webClient.getResponse() returns a proper Response and thus
> Response r = webClient.getResponse();
> r.getStatus();
> r.getEntity();
> r.getMetaData();
> will work fine.
> For multiple webClient.getResponse() calls to work the responseBuilder needs
> be cloned which is fairly cheap operation which can be easily avoided being
> called multiple times by doing a single webClient.getResponse().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.