// add output attachments
map = CastUtils.cast((Map<?, ?>)ctx.getMessageContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS));
try {
DataSource ds = new AttachmentDataSource("image/jpeg", getClass().getResourceAsStream("/Splash.jpg"));
map.put(MtomTestHelper.RESP_IMAGE_CID, new DataHandler(ds));
} catch (IOException e) {
e.printStackTrace();
}
try {
DataSource ds = new AttachmentDataSource("application/octet-stream",
new ByteArrayInputStream(MtomTestHelper.RESP_PHOTO_DATA));
map.put(MtomTestHelper.RESP_PHOTO_CID, new DataHandler(ds));
} catch (IOException e) {
e.printStackTrace();