0
votes

How do I retrieve SOAP attachments? I am doing something like the following:

Iterator<AttachmentPart> i = soapMessage.getAttachments();
while(i.hasNext())
{
    AttachmentPart obj = i.next();
    InputStream rawContent = obj.getRawContent();
}

The raw content returns something like:

------=_Part_2980_1570690085.1342564119748

content-type: image/png; Name=IMG_0583.png

content-transfer-encoding: BASE64

content-disposition: Attachment; Filename=IMG_0583.png

content-id: 1

content-location: IMG_0583.png

content-length: 11210

iVBORw0KGgoAAAANSUhEUgAAARMAAABfCAMAAAD8mtMpAAAC/VBMVEUBIrIZH6qfBSGwAyWSDiTE Aym9DifSCyysGCiQISvJES3eDDLMFinYGDDdFyzkGjbmGzGhMTePNjwsSa3JKDQYTukOZh3iKDKK

------=_Part_2980_1570690085.1342564119748--

How do I retrieve the part I highlighted in bold above?

1

1 Answers

0
votes

I think you want to use the getContent method and not the raw:

obj.getContent();

or the getBase64Content method also as the encoding is base64