Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class AddAttachmentMessageProcessor implements MessageProcessor
public MuleEvent process(MuleEvent event) throws MuleException
Collection<Attachment> attachments = new ArrayList<Attachment>();
AttachmentImpl attachment = new AttachmentImpl("1");
String attachmentXML = "";
attachmentXML = IOUtils.getResourceAsString("attachment.xml", this.getClass());
catch (IOException e)
DataSource source = new ByteArrayDataSource(attachmentXML.getBytes(), "text/xml");
attachment.setDataHandler(new ConfigurableDataHandler(source));
event.getMessage().setInvocationProperty(CxfConstants.ATTACHMENTS, attachments);
return event;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.