I receive an SAAJ message with SOAP with Attachments API for Java, that contain multipart/related attachment. One part of this attachment is multipart/related too. That is I have AttachmentPart with multipart/related content. Is there a standard way to parse it?
In particular, I need to parse MMS(MM7)-message
Solved
All I need is cast AttachmentPart.getContent()'s result to MimeMultipart
MimeMultipart mp = (MimeMultipart) attachment.getContent();
for (int i = 0; i < mp.getCount(); i++) {
Part bp = mp.getBodyPart(i);
if (bp.isMimeType("text/*")) {
String text = (String)bp.getContent();
//process text
} else if (bp.isMimeType("image/*")) {
InputStream is = bp.getInputStream();
//process image
}
}