cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r794778 - /cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
Date Thu, 16 Jul 2009 19:01:56 GMT
Author: dkulp
Date: Thu Jul 16 19:01:56 2009
New Revision: 794778

URL: http://svn.apache.org/viewvc?rev=794778&view=rev
Log:
[CXF-2344] Make sure id and headers are copied in attachments

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java?rev=794778&r1=794777&r2=794778&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
Thu Jul 16 19:01:56 2009
@@ -21,6 +21,7 @@
 
 
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.ResourceBundle;
 
 import javax.xml.namespace.QName;
@@ -108,13 +109,17 @@
                 StaxUtils.copy(node, new W3CDOMStreamWriter(part));
             }
 
-            
-            // TODO: setup mime headers
             Collection<Attachment> atts = message.getAttachments();
             if (atts != null) {
                 for (Attachment a : atts) {
                     AttachmentPart ap = soapMessage.createAttachmentPart(a.getDataHandler());
-                    
+                    ap.setContentId(a.getId());
+                    Iterator<String> i = a.getHeaderNames();
+                    while (i != null && i.hasNext()) {
+                        String h = i.next();
+                        String val = a.getHeader(h);
+                        ap.addMimeHeader(h, val);
+                    }
                     soapMessage.addAttachmentPart(ap);
                 }
             }



Mime
View raw message