cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] Created: (CXF-3288) Multiple Client.getResponse() calls do not work
Date Tue, 25 Jan 2011 16:27:45 GMT
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.


Mime
View raw message