Title: Setting Mime Header - Content-Transfer-Encoding

Hi,

I am using SOAP with attachments and have created a DataSource class to handle Base64 Encoding of ByteArrayInput/Output streams.  I can successfully create the attachments but cannot work out how to set the Mime Header for the encoding.  i.e. I need to replace "Content-Transfer-Encoding: binary" with "Content-Transfer-Encoding: base64" in the snippet:

------=_Part_2_1459641.1044268406886
Content-Type: image/jpeg
Content-Transfer-Encoding: binary
Content-Id: <1654BF562F49F6C634B719A66951870D>

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PD....

My first thought was to use:
byte[] b = ...

DataSource ds = new ByteArrayDataSource("photo", "image/jpeg", b);
DataHandler dh = new DataHandler(ds);
AttachmentPart att = m.createAttachmentPart(dh);

att.setMimeHeader("Content-Transfer-Encoding" , "base64");
   
m.addAttachmentPart(att);

but this has no effect!  Can anyone help?

Rob

Reply via email to