Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 32622 invoked from network); 6 Feb 2011 18:08:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Feb 2011 18:08:54 -0000 Received: (qmail 61436 invoked by uid 500); 6 Feb 2011 18:08:54 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 61333 invoked by uid 500); 6 Feb 2011 18:08:52 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 61320 invoked by uid 99); 6 Feb 2011 18:08:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Feb 2011 18:08:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Feb 2011 18:08:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E68E41955FD for ; Sun, 6 Feb 2011 18:08:30 +0000 (UTC) Date: Sun, 6 Feb 2011 18:08:30 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: <1763021792.2832.1297015710940.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <448728564.6697.1296710789562.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (CXF-3304) WebClient POST to a resource that returns 401 returns a blank InputStream when there's supposed to be text MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-3304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991190#comment-12991190 ] Sergey Beryozkin commented on CXF-3304: --------------------------------------- I've debugged and I can see that HttpURLConnection is returning an empty stream, both for conn.getInputStream and conn.getErrorStream(), despite the fact the text is contained in the error response. Can you please verify it on your own, first check that the server actually returns the text, using the tcptrace, and then check the streams explicitly, perhaps using Apache HttpClient or just useing HTTPURLConnection directly ? I suspect it is just a strange error in the Java HTTPUrlConnection. I believe 401 is usually supposed to have no response body so it could be HTTPUrlConnection enforces it by ignoring the response text if any cheers, Sergey > WebClient POST to a resource that returns 401 returns a blank InputStream when there's supposed to be text > ---------------------------------------------------------------------------------------------------------- > > Key: CXF-3304 > URL: https://issues.apache.org/jira/browse/CXF-3304 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.3.2 > Environment: JDK 1.6 > Reporter: Jason Downey > Priority: Minor > Fix For: 2.3.3 > > Attachments: cxf_jax_rs_post_401_bug.zip > > > I have two methods that return the same error message upon POST. The only difference is that one returns a 404 response status, the other returns a 401 response status. > POSTing to the resource that returns 404 returns an InputStream containing the error message when you call Response.getEntity(). However, POSTing to the resource that returns 401 returns a blank InputStream when you call Response.getEntity(). > This problem was not reproducible with GET. > Test case code attached. Launch the server using JettyServer. Then run the WebClient test in WebClientTest. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira