You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2008/05/07 08:50:04 UTC

svn commit: r654008 - /cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java

Author: ffang
Date: Tue May  6 23:50:03 2008
New Revision: 654008

URL: http://svn.apache.org/viewvc?rev=654008&view=rev
Log:
[CXF-1573]JBIDestinationOutputStream should copy attachments into NormalizedMessage to support outbound attachments

Modified:
    cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java

Modified: cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java?rev=654008&r1=654007&r2=654008&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java (original)
+++ cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java Tue May  6 23:50:03 2008
@@ -36,6 +36,7 @@
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.io.CachedOutputStream;
+import org.apache.cxf.message.Attachment;
 import org.apache.cxf.message.Message;
 
 public class JBIDestinationOutputStream extends CachedOutputStream {
@@ -95,6 +96,13 @@
                     }
                 } else {
                     NormalizedMessage msg = xchng.createMessage();
+                    //copy attachments
+                    if (inMessage.getAttachments() != null) {
+                        for (Attachment att : inMessage.getAttachments()) {
+                            msg.addAttachment(att.getId(), att
+                                    .getDataHandler());
+                        }
+                    }
                     msg.setContent(new DOMSource(doc));
                     xchng.setMessage(msg, "out");