The following shows a snippet of code for retrieving an attachment from an inbound SOAP message with attachments.
public void mediate(InputTerminal input, DataObject message) throws MediationConfigurationException, MediationBusinessException { ServiceMessageObject smo = (ServiceMessageObject)message; Attachments attachments = Attachments.INSTANCE; String contextID = attachments.getAttachmentContextIDForSMO(smo); Iterator it = attachments.getAllMetaData(contextID); // In this example, we assume there’s one attachment and take the first one AttachmentMetaData metadata = (AttachmentMetaData)it.next(); InputStream is = attachments.getAttachmentContent(contextID, metadata.getAttachmentID()); // Read from stream }