You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sunil Bapat <su...@gmail.com> on 2012/08/27 17:49:11 UTC

interceptor custom property

I have custom in and out interceptors. I want to set a property in the in
interceptor, which I want to access in the out interceptor. What is the
appropriate way to do that?

In SOAP Handlers, I was using SOAPMessageContext.put/get, and that was
working. What is the equivalent in interceptors?

In the in interceptor, I tried SOAPMessage.put("key", value"), and tried to
get it using message.get("key") in the out interceptor, but always get a
null. I also tried SOAPMessage.setContextualProperty and
getContextualProperty, that was null as well.

Thanks
Sunil.

Re: interceptor custom property

Posted by Daniel Kulp <dk...@apache.org>.
On Aug 27, 2012, at 11:49 AM, Sunil Bapat <su...@gmail.com> wrote:

> I have custom in and out interceptors. I want to set a property in the in
> interceptor, which I want to access in the out interceptor. What is the
> appropriate way to do that?

Usually you would use the Exchange object for that:

message.getExchange().put("my.property", value);

The properties on the message itself are really just there for the scope of that message.


Dan



> In SOAP Handlers, I was using SOAPMessageContext.put/get, and that was
> working. What is the equivalent in interceptors?
> 
> In the in interceptor, I tried SOAPMessage.put("key", value"), and tried to
> get it using message.get("key") in the out interceptor, but always get a
> null. I also tried SOAPMessage.setContextualProperty and
> getContextualProperty, that was null as well.
> 
> Thanks
> Sunil.

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