Message m = new MessageImpl(message.getSOAPPart().getEnvelope());
if (message.countAttachments() > 0) {
Iterator it = message.getAttachments();
while (it.hasNext()) {
AttachmentPart ap = (AttachmentPart)it.next();
m.addDataHandler(ap.getDataHandler(), ap.getContentId());
}
}
return m;
} catch (Exception e) {
throw ExceptionFactory.makeWebServiceException(e);