It's definitely doable with an Interceptor. If you want to write an
interceptor (not hard) that runs in an early phase (like user_logical), then
you can do it. The interceptor's handleMessage call would look something
like:
message.getInterceptorChain().add(new AttachmentOutInterceptor());
message.put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
Collection<Attachment> atts = message.getAttachments();
if (atts == null) {
atts = new ArrayList<Attachment>();
message.setAttachments(atts);
}
atts.add(.......);
Basically, the Collection<Attachment> thing is where you would add your
attachment. The AttachmentOutInterceptor (which is probably already on the
chain so you MAY be able to skip that) is what will write it out.
Dan
On Tue March 31 2009 2:56:45 am Roderic Green wrote:
> Thank your for your answer.
>
> Does it mean, that I have to modify wsdl and add a new parameter for data I
> want to be sent as attachment?
>
> And - is there any documentation on how to use CXF with services which
> don't support MTOM ?
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog