tcassan wrote
EDIT: I checked again: actually, I made a mistake. I have this operation in the helper, I just thought this was the one that was deprecated. I think I will use this operation then, since it seems to do the trick I want. If you have some time to answer, I am still interested in a POJO styled solution.
It depends on the way you want to return the attachment.
The simple solution is to create a data handler (take a look at the Talend SE in the Petals source code for an example) and to attach it to the exchange.
For a better solution, you should use a MTOM attachment.
It means there is an attachment and that this attachment is referenced in the XML payload. There are utilities in the CDK to do it. Or you can take a handy approach (once again, take a look at the Talend SE, the abstract processor how to add MTOM attachments on Petals messages).
« Petals M.D. »