On Thursday 27 March 2008, Daniel Kulp wrote:
> 
> Yea, looking at the code for the sessions stuff in the http conduit, the 
> sessionMaintain setting is only read from current message. Thus, that 
> requires being able to set properties on the currently dispatching 
> message.  The JAX-WS frontend has the 
> BindingProvider.getRequestContext() stuff to set those properties.   The 
> simple frontend doesn't have any sort of request context or ability to 
> pre-set properties on the message.   Thus, it wouldn't work.
> 
> The only way to get it to work would be to write a simple interceptor 
> that just does:
> message.put(Message.MAINTAIN_SESSION, Boolean.TRUE);
> 
> and configure that on the outbound chain for the client.
> 
> Dan
> 

Hi Dan,

thanks for the info.
I would like to get rid of the JaxWS dependency since SimpleClient is good 
enough for me

I did take a look at http://cwiki.apache.org/CXF20DOC/interceptors.html
and I ended up with:

-------------------------------------
    public static class MyInterceptor extends AbstractSoapInterceptor {
        public void handleMessage(SoapMessage message) throws Fault {
            logger.info("Hi there");
            message.put(Message.MAINTAIN_SESSION, true);
        }
    }

...
   TestInterface ldap = (TestInterface) context.getBean(TestClient");

   ClientProxy.getClient(test).getOutInterceptors().add(new MyInterceptor());
                          |
                          |____ This is my proxy client
--------------------------------------

but the message "Hi there" is never printed.

I am obviously missing something but what?
Maybe the type of the Interceptor that I am extending?

        .bill

Reply via email to