You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Tom McLean <tm...@feith.com> on 2013/08/06 23:09:25 UTC

SOAPHeaderInterceptor Removing Message Headers

Hi All,

Is there any reason why the SOAPHeaderInterceptor is removing headers from the SoapMessage? It looks like the first thing it does when it finds a header is call "message.getHeaders().remove(param);". Is this really necessary? This makes it very frustrating to anyone developing an interceptor that depends on SOAP header information as said interceptor would have to be invoked somewhere in the *_PROTOCOL phases.

Thanks,

Tom McLean

Re: SOAPHeaderInterceptor Removing Message Headers

Posted by Daniel Kulp <dk...@apache.org>.
On Aug 6, 2013, at 5:09 PM, Tom McLean <tm...@feith.com> wrote:

> Hi All,
> 
> Is there any reason why the SOAPHeaderInterceptor is removing headers from the SoapMessage? It looks like the first thing it does when it finds a header is call "message.getHeaders().remove(param);". Is this really necessary?

In general, this does two things:

1) It makes sure the header is then considered "understood".   If the header has a mustUnderstand or similar, by having it removed, the MustUnderstandInterceptors no longer would know about it and thus won't throw an exception.

2) Allows some level of garbage collection of stuff that has already been processed.   This really mimics what happens in the "Body" in that as the data is read, the events are discarded.


> This makes it very frustrating to anyone developing an interceptor that depends on SOAP header information as said interceptor would have to be invoked somewhere in the *_PROTOCOL phases.

Thanks to this note, I've realized that on the MARSHAL side, we have PRE_MARSHAL and POST_MARSHAL phases, but we don't have such phases on the UNMARSHALL side.   I'll definitely get that fixed, mostly for consistency but should allow some easier configuration of interceptors that need to be stuck in between some of the processing.

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