cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roderic Green <cxfrode...@gmail.com>
Subject Re: Non-MTOM attachment NOT defined in WSDL
Date Wed, 01 Apr 2009 05:52:24 GMT
Thanks for you answer Daniel,

  Attachment I need to send is different for each WS method invocation (it
is like an additional merthod argument). Are interceptors designed for such
use? What about synchronisation etc.



-- 

Roderic

2009/3/31 Daniel Kulp <dkulp@apache.org>

>
> 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
> dkulp@apache.org
> http://www.dankulp.com/blog
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message