MessageContext msgCtx = MessageContext.getCurrentMessageContext();
Attachments attachment = msgCtx.getAttachmentMap();
DataHandler dataHandler = attachment.getDataHandler(imageContentId);
File tempFile = File.createTempFile("swa-", ".gif");
FileOutputStream fos = new FileOutputStream(tempFile);
dataHandler.writeTo(fos);
fos.flush();
fos.close();
System.out.println("Wrote SwA attachment to temp file : " + tempFile.getAbsolutePath());
MessageContext outMsgCtx = msgCtx.getOperationContext().