cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1167046 - in /cxf/trunk: api/src/main/java/org/apache/cxf/message/Message.java rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Date Fri, 09 Sep 2011 08:49:07 GMT
Author: ningjiang
Date: Fri Sep  9 08:49:07 2011
New Revision: 1167046

URL: http://svn.apache.org/viewvc?rev=1167046&view=rev
Log:
CXF-3796 Introduce an header to disable the handling the PartialResponse when the response
code is 202

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java?rev=1167046&r1=1167045&r2=1167046&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java Fri Sep  9 08:49:07 2011
@@ -68,7 +68,9 @@ public interface Message extends StringM
     String DECOUPLED_CHANNEL_MESSAGE = "decoupled.channel.message";
     String PARTIAL_RESPONSE_MESSAGE = "org.apache.cxf.partial.response";
     String EMPTY_PARTIAL_RESPONSE_MESSAGE = "org.apache.cxf.partial.response.empty";
+    String HANDLING_PARTIAL_RESPONSE_MESSAGE = "org.apache.cxf.partial.response.handling";
     String ONE_WAY_REQUEST = "OnewayRequest";
+    
 
     
     String HTTP_REQUEST_METHOD = "org.apache.cxf.request.method";

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1167046&r1=1167045&r2=1167046&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Fri Sep  9 08:49:07 2011
@@ -1529,6 +1529,13 @@ public class HTTPConduit 
         protected void handleResponseInternal() throws IOException {
             Exchange exchange = outMessage.getExchange();
             int responseCode = connection.getResponseCode();
+            // handling the particalResponse by default
+            boolean handlingParticalResponse = true;
+            // this option will be set to false when we leverage the CXF transport to send
stream message
+            if (Boolean.FALSE.equals(outMessage.get(Message.HANDLING_PARTIAL_RESPONSE_MESSAGE)))
{
+                handlingParticalResponse = false;
+            }
+            
             if (outMessage != null && exchange != null) {
                 exchange.put(Message.RESPONSE_CODE, responseCode);
             }
@@ -1546,7 +1553,8 @@ public class HTTPConduit 
 
             InputStream in = null;
             // oneway or decoupled twoway calls may expect HTTP 202 with no content
-            if (isOneway(exchange) || HttpURLConnection.HTTP_ACCEPTED == responseCode) {
+            if (isOneway(exchange) 
+                || (HttpURLConnection.HTTP_ACCEPTED == responseCode && handlingParticalResponse))
{
                 in = ChunkedUtil.getPartialResponse(connection, responseCode);
                 if (in == null) {
                     // oneway operation or decoupled MEP without 



Mime
View raw message