Do I need to setup the interceptor?

On Monday 20 April 2009 18:44:17 you wrote:
> Couple of ways to do it:
>
> JAX-WS standard way would be through the WebserviceContext:
>
> context.getMessageContext().get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)
>
> which would return a Map<String, DataHandler>
>
>
> Semi CXF specific: you can use the WebServiceContext, but cast to the
> specific CXF type and get the AttachmentList.   That avoids some of the
> conversion that the above would do and enables better streaming:
>
> ((org.apache.cxf.jaxws.context.WrappedMessageContext)context.getMessageCont
>ext()).getWrappedMessage().getAttachments()
>
> That would return Collection<org.apache.cxf.message.Attachment>.
>
>
> Another option with 2.2:
> PhaseInterceptorChain.getCurrentMessage().getAttachments();
>
>
>
> Dan
>
> On Sun April 19 2009 6:21:24 pm John Baker wrote:
> > Hello,
> >
> > What's the quickest/easiest way to get attachments from a SOAP call in
> > CXF?
> >
> > Do we have to use an interceptor, as detailed here:
> > http://cwiki.apache.org/CXF20DOC/interceptors.html
> >
> > Or is there an easier way, using a WebserviceContext perhaps?
> >
> > This is the Apache way, which is fairly triival:
> >
> >
> > org.apache.axis.MessageContext context =
> >    org.apache.axis.MessageContext.getCurrentContext();
> > Message message = context.getRequestMessage();
> > Iterator<AttachmentPart> i = message.getAttachments();
> >
> > Thanks
> >
> >
> > John

Reply via email to