You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "pravin deore (JIRA)" <ji...@apache.org> on 2016/04/21 21:37:25 UTC

[jira] [Created] (CXF-6876) Unable to get XML response from org.apache.cxf.message.Message.getContent(InputStream.class)

pravin deore created CXF-6876:
---------------------------------

             Summary: Unable to get XML response from org.apache.cxf.message.Message.getContent(InputStream.class)
                 Key: CXF-6876
                 URL: https://issues.apache.org/jira/browse/CXF-6876
             Project: CXF
          Issue Type: Bug
            Reporter: pravin deore


In the version 2.7.8 

org.apache.cxf.message.Message.getContent(InputStream.class) used to return the InputStream object but with version 3.0.5 we are now getting the SequenceInputStream object ,and there is no way to get the inputstream from it. 

Issue is because of code change being made in "LoggingInInterceptor" class 
logInputStream(message, is, buffer, encoding, ct) method which contains the following code 

//only copy up to the limit since that's all we need to log
            //we can stream the rest
            IOUtils.copyAtLeast(bis, bos, limit == -1 ? Integer.MAX_VALUE : limit);
            bos.flush();
            bis = new SequenceInputStream(bos.getInputStream(), bis);
            
            // restore the delegating input stream or the input stream
            if (is instanceof DelegatingInputStream) {
                ((DelegatingInputStream)is).setInputStream(bis);
            } else {
                message.setContent(InputStream.class, bis);
            }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)