cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r654008 - /cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
Date Wed, 07 May 2008 06:50:04 GMT
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");
                     



Mime
View raw message