if (log.isDebugEnabled())
log.debug("Created base64 representation for content-type " + contentType);
// cleanup the attachment part
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
if (cid.startsWith("cid:"))
cid = cid.substring(4);
cid = '<' + cid + '>';
AttachmentPart removedPart = soapMessage.removeAttachmentByContentId(cid);
if (null == removedPart)
throw new WSException("Unable to remove attachment part " + cid);
if (log.isDebugEnabled())
log.debug("Removed attachment part " + cid);