|
| We are trying to change the Content-Transfer-Encoding value to 8bit in the MIME header for an attachment being sent with a SOAP message. However using the following sample code always results in the Content-transfer-Encoding value being 'binary':
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage message = messageFactory.createMessage();
AttachmentPart ap1 = message.createAttachmentPart();
ap1.setContentId("NewContentIDSet");
ap1.setContentLocation("NewContentLocation");
ap1.setContent("Content-Transfer-Encoding","8bit");
ap1.setContent("hello world", "text/application");
message.addAttachmentPart(ap1);
SOAPPart soapPart = message.getSOAPPart();
SOAPEnvelope envelope = soapPart.getEnvelope();
SOAPHeader header = envelope.getHeader();
SOAPBody body = envelope.getBody();
header.detachNode();
//Save the message
message.saveChanges();
message.writeTo(System.out);
Any help would be much appreciated.
|
|