cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1497683 - in /cxf/branches/2.6.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/context/
Date Fri, 28 Jun 2013 08:42:35 GMT
Author: ay
Date: Fri Jun 28 08:42:34 2013
New Revision: 1497683

URL: http://svn.apache.org/r1497683
Log:
Merged revisions 1497433 via  svn merge from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1497433 | ay | 2013-06-27 18:39:42 +0200 (Thu, 27 Jun 2013) | 9 lines
  
  Merged revisions 1497340 via  svn merge from
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1497340 | ay | 2013-06-27 15:12:22 +0200 (Thu, 27 Jun 2013) | 1 line
    
    [CXF-5095] Allow adding attachments to the context using jaxws attachments
  ........
  
........

Added:
    cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedAttachments.java
      - copied unchanged from r1497433, cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedAttachments.java
    cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/context/WrappedMessageContextTest.java
      - copied unchanged from r1497433, cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/context/WrappedMessageContextTest.java
Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java

Propchange: cxf/branches/2.6.x-fixes/
            ('svn:mergeinfo' removed)

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java?rev=1497683&r1=1497682&r2=1497683&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
Fri Jun 28 08:42:34 2013
@@ -358,11 +358,15 @@ public class WrappedMessageContext imple
             return null;
         }
         Collection<Attachment> attachments = CastUtils.cast((Collection<?>)mc.get(Message.ATTACHMENTS));
-        Map<String, DataHandler> dataHandlers = 
-            AttachmentUtil.getDHMap(attachments);
-        mc.put(propertyName, 
-               dataHandlers);
-        scopes.put(propertyName, Scope.APPLICATION);
+        Map<String, DataHandler> dataHandlers;
+        if (attachments instanceof WrappedAttachments) {
+            dataHandlers = ((WrappedAttachments) attachments).getAttachments();
+        } else {
+            dataHandlers = AttachmentUtil.getDHMap(attachments);
+            mc.put(propertyName, 
+                   dataHandlers);
+            scopes.put(propertyName, Scope.APPLICATION);
+        }
         return dataHandlers;
     }    
         
@@ -416,7 +420,6 @@ public class WrappedMessageContext imple
         Object ret = null;
         if ((MessageContext.HTTP_RESPONSE_HEADERS.equals(key)
             || MessageContext.HTTP_RESPONSE_CODE.equals(key)
-            || MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS.equals(key)
             || MessageContext.HTTP_RESPONSE_CODE.equals(key))
             && !isResponse() && !isRequestor()) { 
             Message tmp = createResponseMessage();
@@ -447,6 +450,9 @@ public class WrappedMessageContext imple
             authPolicy.setPassword((String)value);
         } else if (MessageContext.HTTP_REQUEST_HEADERS.equals(key)) {
             ret = message.put(Message.PROTOCOL_HEADERS, value);
+        } else if (MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS.equals(key)) {
+            Map<String, DataHandler> attachments = CastUtils.cast((Map<?, ?>)value);
+            ret = message.put(Message.ATTACHMENTS, new WrappedAttachments(attachments));
         } else if (SoapBindingConstants.SOAP_ACTION.equals(mappedKey)
             && !isRequestor() && exchange != null) {
             Message tmp = createResponseMessage();



Mime
View raw message