|
From: <cy...@us...> - 2003-07-11 03:50:40
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport
In directory sc8-pr-cvs1:/tmp/cvs-serv7790
Modified Files:
Mail.java
Log Message:
Bug fix: if no payload is added, SOAPPart is base64-ed twice.
Index: Mail.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport/Mail.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** Mail.java 17 Jun 2003 04:24:28 -0000 1.39
--- Mail.java 11 Jul 2003 03:50:35 -0000 1.40
***************
*** 517,534 ****
session = Session.getInstance(properties);
}
-
session.setDebug(debug);
- final SOAPMessage soapMessage = ebxmlMessage.getSOAPMessage();
final boolean hasAttachments = ebxmlMessage.getPayloadCount() > 0;
-
final ByteArrayOutputStream out = new ByteArrayOutputStream();
! ebxmlMessage.writeTo(
! out, MAIL_TRANSFER_ENCODING, MAIL_TRANSFER_ENCODING);
! String type = (String) ebxmlMessage.getMimeHeaders(
! MAIL_TRANSFER_ENCODING, MAIL_TRANSFER_ENCODING)
! .get(CONTENT_TYPE);
final AttachmentDataSource content =
! new AttachmentDataSource(out.toByteArray(), type);
MimeMessage mimeMessage = new MimeMessage(session);
MimeMultipart multipart = null;
--- 517,542 ----
session = Session.getInstance(properties);
}
session.setDebug(debug);
final boolean hasAttachments = ebxmlMessage.getPayloadCount() > 0;
final ByteArrayOutputStream out = new ByteArrayOutputStream();
! String contentType = null;
! if (hasAttachments) {
! contentType = Constants.MULTIPART_RELATED_TYPE + "\"" +
! EbxmlMessage.mimeBoundary + "\"; " +
! Constants.CHARACTER_SET + "=\"" +
! Constants.CHARACTER_ENCODING + "\"; " + Constants.START +
! "=\"<" + EbxmlMessage.SOAP_PART_CONTENT_ID + ">\"";
! ebxmlMessage.writeTo(out, MAIL_TRANSFER_ENCODING,
! MAIL_TRANSFER_ENCODING);
! }
! else {
! contentType = Constants.TEXT_XML_TYPE + "; " +
! Constants.CHARACTER_SET + "=\"" +
! Constants.CHARACTER_ENCODING + "\"";
! ebxmlMessage.writeTo(out);
! }
final AttachmentDataSource content =
! new AttachmentDataSource(out.toByteArray(), contentType);
MimeMessage mimeMessage = new MimeMessage(session);
MimeMultipart multipart = null;
|