Hmmm......    I think the only way to do this right now is similar to what 
you've done.   Basically, have a "AddOtherInterceptorsInterceptor" configured 
into the chains that looks someplace for additional interceptors to add.

The question is where to look for additional interceptors.   It might be nice 
to have it look on the message or exchange for a specific key to be  a list 
of interceptors:

List<Interceptor> lst = message.get(INTERCEPTOR_LIST);
chain.add(lst);

or similar.

Dan





On Wednesday 28 January 2009 10:49:22 am Kenny MacLeod wrote:
> Folks,
>
> I have a requirement to use a JAX-WS client proxy using custom
> interceptors which change from request to request.
>
> I'm currently doing this by using JaxWsProxyFactoryBean to create a new
> proxy client each time, and injecting the interceptor each time.
> However, this means going through the whole client creation process each
> time, which is inefficient and inelegant.
>
> The interaction between ClientFactoryBean and ClientProxyFactoryBean
> suggests that this is unavoidable - there seems to be no simple way to
> decorate the client proxy with interceptors that are private to the
> current thread.  I could just store the interceptor in a ThreadLocal,
> and then retrieve it using a fixed, delegating interceptor, but again
> that seems a bit clunky.
>
> So, is it possible in the CXF API to have a single instance of a proxy
> client, which I can decorate with additional interceptors on a
> per-request basis?
>
> kenny



-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to