On Aug 6, 2013, at 5:09 PM, Tom McLean <[email protected]> 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
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to