You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Nicolas Mugnier <nm...@gnubila.fr> on 2013/12/04 12:11:38 UTC

CXF Interceptors (in/out): intercept SOAP Message without attachment

Hello all,

I would like to intercept in and out SOAP Messages.
However, we have to upload/download files: thus, I would like to intercept
these SOAP Messages /without/ the attachment(s) (SOAP Messages with
attachment are too big !)

I tried to create my own interceptors extending the CXF ones in the
different phases (PRE_STREAM, ...), however I didn't find out how to skip
the attachment... 

Hope you could help me,
Best regards,
Nicolas.



--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-Interceptors-in-out-intercept-SOAP-Message-without-attachment-tp5737348.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: CXF Interceptors (in/out): intercept SOAP Message without attachment

Posted by Daniel Kulp <dk...@apache.org>.
On Dec 4, 2013, at 6:11 AM, Nicolas Mugnier <nm...@gnubila.fr> wrote:

> Hello all,
> 
> I would like to intercept in and out SOAP Messages.
> However, we have to upload/download files: thus, I would like to intercept
> these SOAP Messages /without/ the attachment(s) (SOAP Messages with
> attachment are too big !)
> 
> I tried to create my own interceptors extending the CXF ones in the
> different phases (PRE_STREAM, ...), however I didn't find out how to skip
> the attachment... 

It completely depends on where in the chain and what you are trying to do.   If you run after the StaxInInterceptor, then if you call the msg.getContent(XMLStreamReader.class), that stream reader would just give you access to the soap message part and not really any of the attachments.   However if you explicitely ask for the attachments, then CXF will load them and such.   For the most part, CXF always streams things and as long as you don’t ask for them in a way that would require them to be buffered, you should be all set.


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com