servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r587428 - /incubator/servicemix/trunk/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
Date Tue, 23 Oct 2007 09:08:28 GMT
Author: gnodet
Date: Tue Oct 23 02:08:27 2007
New Revision: 587428

URL: http://svn.apache.org/viewvc?rev=587428&view=rev
Log:
SM-1114: encoding in soap requests is always 7bit

Modified:
    incubator/servicemix/trunk/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java

Modified: incubator/servicemix/trunk/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java?rev=587428&r1=587427&r2=587428&view=diff
==============================================================================
--- incubator/servicemix/trunk/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
(original)
+++ incubator/servicemix/trunk/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
Tue Oct 23 02:08:27 2007
@@ -34,6 +34,7 @@
 import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMultipart;
+import javax.mail.internet.MimeUtility;
 import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 import javax.xml.parsers.ParserConfigurationException;
@@ -139,6 +140,7 @@
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         writeSimpleMessage(baos);
         soapPart.setDataHandler(new DataHandler(new ByteArrayDataSource(baos.toByteArray(),
"text/xml")));
+        soapPart.addHeader("Content-Transfer-Encoding", "8bit");
         parts.addBodyPart(soapPart);
         // Add attachments
         for (Iterator itr = message.getAttachments().entrySet().iterator(); itr.hasNext();)
{
@@ -148,6 +150,12 @@
             MimeBodyPart part = new MimeBodyPart();
             part.setDataHandler(dh);
             part.setContentID("<" + id + ">");
+            // get the encoding type from the DH
+            String encodingType = MimeUtility.getEncoding(dh);
+            if ("7bit".equals(encodingType)) {
+                encodingType = "8bit";
+            }
+            part.addHeader("Content-Transfer-Encoding", encodingType);
             parts.addBodyPart(part);
         }
         mime.setContent(parts);



Mime
View raw message