cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r780917 - in /cxf/branches/2.1.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java
Date Tue, 02 Jun 2009 02:57:21 GMT
Author: dkulp
Date: Tue Jun  2 02:57:21 2009
New Revision: 780917

URL: http://svn.apache.org/viewvc?rev=780917&view=rev
Log:
Merged revisions 780800 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r780800 | dkulp | 2009-06-01 15:45:26 -0400 (Mon, 01 Jun 2009) | 2 lines
  
  [CXF-2250] Fix issue of .INBOUND_MESSAGE_ATTACHMENTS not being mapped
  correctly on the client side.
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun  2 02:57:21 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800

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

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java?rev=780917&r1=780916&r2=780917&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
Tue Jun  2 02:57:21 2009
@@ -204,13 +204,22 @@
                 }
             }
             if (MessageContext.INBOUND_MESSAGE_ATTACHMENTS.equals(key)) {
-                if (isOutbound()) {
-                    ret = reqMessage.get(key);
+                if (isRequestor() && isOutbound()) {
+                    ret = null;
+                } else if (isOutbound()) {
+                    ret = createAttachments(reqMessage, 
+                                            MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
+                } else {
+                    ret = createAttachments(message, 
+                                            MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
                   
                 }
-                ret = createAttachments(getWrappedMessage(), MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
             } else if (MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS.equals(key)) {
-                ret = createAttachments(isRequestor() ? getWrappedMessage() : createResponseMessage(),
-                    MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+                if (isRequestor() && !isOutbound()) {
+                    ret = createAttachments(reqMessage, MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+                } else {
+                    ret = createAttachments(isRequestor() ? getWrappedMessage() : createResponseMessage(),
+                        MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+                }
             } else if (MessageContext.MESSAGE_OUTBOUND_PROPERTY.equals(key)) {
                 ret = isOutbound();
             } else if (MessageContext.HTTP_REQUEST_HEADERS.equals(key)) {
@@ -283,11 +292,11 @@
         }
         return m;
     }
-    private Object createAttachments(Message mc, String propertyName) {
+    private Object createAttachments(Map<String, Object> mc, String propertyName) {
         if (mc == null) {
             return null;
         }
-        Collection<Attachment> attachments = mc.getAttachments();
+        Collection<Attachment> attachments = CastUtils.cast((Collection<?>)mc.get(Message.ATTACHMENTS));
         Map<String, DataHandler> dataHandlers = 
             AttachmentUtil.getDHMap(attachments);
         mc.put(propertyName, 

Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java?rev=780917&r1=780916&r2=780917&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java
Tue Jun  2 02:57:21 2009
@@ -21,6 +21,7 @@
 import java.awt.Image;
 import java.io.InputStream;
 import java.net.URL;
+import java.util.Map;
 
 import javax.activation.DataHandler;
 import javax.imageio.ImageIO;
@@ -32,10 +33,13 @@
 import javax.xml.soap.SOAPMessage;
 import javax.xml.transform.Source;
 import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Dispatch;
 import javax.xml.ws.Holder;
 import javax.xml.ws.Service;
+import javax.xml.ws.handler.MessageContext;
 
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.swa.SwAService;
 import org.apache.cxf.swa.SwAServiceInterface;
@@ -218,7 +222,12 @@
         VoidRequest request = new VoidRequest();
         OutputResponseAll response = port.echoAllAttachmentTypes(request, attach1, attach2,
attach3, attach4,
                                                                  attach5);
+        
         assertNotNull(response);
+        Map<?, ?> map = CastUtils.cast((Map<?, ?>)((BindingProvider)port).getResponseContext()
+                                           .get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS));
+        assertNotNull(map);
+        assertEquals(5, map.size()); 
     }
     
     @Test



Mime
View raw message