camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r772881 - in /camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf: transport/CamelTransportConstants.java util/CxfHeaderHelper.java
Date Fri, 08 May 2009 08:20:58 GMT
Author: ningjiang
Date: Fri May  8 08:20:57 2009
New Revision: 772881

URL: http://svn.apache.org/viewvc?rev=772881&view=rev
Log:
CAMEL-1589 revert the change of CxfHeaderHelper

Modified:
    camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportConstants.java
    camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfHeaderHelper.java

Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportConstants.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportConstants.java?rev=772881&r1=772880&r2=772881&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportConstants.java
(original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelTransportConstants.java
Fri May  8 08:20:57 2009
@@ -46,6 +46,7 @@
     public static final String CAMEL_SERVER_CONFIG_ID = "camel-server";
     public static final String CAMEL_REBASED_REPLY_TO = "org.apache.cxf.camel.server.replyto";
     public static final String CAMEL_CORRELATION_ID = "org.apache.cxf.camel.correlationId";
+    public static final String CAMEL_CONTENT_TYPE = "CamelConentType";
     
     private CamelTransportConstants() {
         // Utility class

Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfHeaderHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfHeaderHelper.java?rev=772881&r1=772880&r2=772881&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfHeaderHelper.java
(original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfHeaderHelper.java
Fri May  8 08:20:57 2009
@@ -42,11 +42,11 @@
     }
 
     /**
-     * Propagates Camel headers to CXF message.
+     * Progagates Camel headers to CXF message.
      *
      * @param strategy header filter strategy
      * @param headers Camel header
-     * @param message CXF message
+     * @param message CXF meassage
      * @param exchange provides context for filtering
      */
     public static void propagateCamelToCxf(HeaderFilterStrategy strategy,
@@ -64,7 +64,9 @@
             if (strategy != null
                     && !strategy.applyFilterToCamelHeaders(entry.getKey(), entry.getValue(),
exchange)) {
 
-                if (Client.REQUEST_CONTEXT.equals(entry.getKey())
+                if (CamelTransportConstants.CAMEL_CONTENT_TYPE.equals(entry.getKey())) {
+                    message.put(Message.CONTENT_TYPE, entry.getValue());
+                } else if (Client.REQUEST_CONTEXT.equals(entry.getKey())
                             || Client.RESPONSE_CONTEXT.equals(entry.getKey())
                             || Message.RESPONSE_CODE.equals(entry.getKey())) {
                     message.put(entry.getKey(), entry.getValue());
@@ -95,10 +97,17 @@
             }
         }
 
-        // propagate request context
-        String key = Client.REQUEST_CONTEXT;
+        // propagate content type
+        String key = Message.CONTENT_TYPE;
         Object value = message.get(key);
         if (value != null && !strategy.applyFilterToExternalHeaders(key, value, exchange))
{
+            headers.put(CamelTransportConstants.CAMEL_CONTENT_TYPE, value);
+        }
+
+        // propagate request context
+        key = Client.REQUEST_CONTEXT;
+        value = message.get(key);
+        if (value != null && !strategy.applyFilterToExternalHeaders(key, value, exchange))
{
             headers.put(key, value);
         }
 



Mime
View raw message