You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by vickatvuuch <vl...@gmail.com> on 2009/10/21 23:13:38 UTC

How-to pass an object from InInterceptor to outInterceptor

Hi All,

I'm trying to pass an object from my custom inInterceptor for my custom
outInterceptor to pick up and write it to the reply header.

I tried setting it on the message inside an inInterceptor, but that doesn't
make it to my outInterceptor.

message.put("KEY", obj); //this only visible in the inInterceptors

message.get("KEY"); //outInterceptor gets nothing since
OutgoingChainInterceptor not propagating it.


Thanks,
-Vitaly
-- 
View this message in context: http://www.nabble.com/How-to-pass-an-object-from-InInterceptor-to-outInterceptor-tp26000367p26000367.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How-to pass an object from InInterceptor to outInterceptor

Posted by vickatvuuch <vl...@gmail.com>.
Sergey,

Thanks, that's what I ended up doing.


Sergey Beryozkin-2 wrote:
> 
> Hi,
> 
> please do
> 
> inMessage.getExchange().put("KEY", obj);
> and
> outMessage.getExchange().get("KEY");
> 
> cheers, Sergey
> 
> ----- Original Message ----- 
> From: "vickatvuuch" <vl...@gmail.com>
> To: <us...@cxf.apache.org>
> Sent: Wednesday, October 21, 2009 10:13 PM
> Subject: How-to pass an object from InInterceptor to outInterceptor
> 
> 
>>
>> Hi All,
>>
>> I'm trying to pass an object from my custom inInterceptor for my custom
>> outInterceptor to pick up and write it to the reply header.
>>
>> I tried setting it on the message inside an inInterceptor, but that
>> doesn't
>> make it to my outInterceptor.
>>
>> message.put("KEY", obj); //this only visible in the inInterceptors
>>
>> message.get("KEY"); //outInterceptor gets nothing since
>> OutgoingChainInterceptor not propagating it.
>>
>>
>> Thanks,
>> -Vitaly
>> -- 
>> View this message in context: 
>> http://www.nabble.com/How-to-pass-an-object-from-InInterceptor-to-outInterceptor-tp26000367p26000367.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-pass-an-object-from-InInterceptor-to-outInterceptor-tp26000367p26009718.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How-to pass an object from InInterceptor to outInterceptor

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi,

please do

inMessage.getExchange().put("KEY", obj);
and
outMessage.getExchange().get("KEY");

cheers, Sergey

----- Original Message ----- 
From: "vickatvuuch" <vl...@gmail.com>
To: <us...@cxf.apache.org>
Sent: Wednesday, October 21, 2009 10:13 PM
Subject: How-to pass an object from InInterceptor to outInterceptor


>
> Hi All,
>
> I'm trying to pass an object from my custom inInterceptor for my custom
> outInterceptor to pick up and write it to the reply header.
>
> I tried setting it on the message inside an inInterceptor, but that doesn't
> make it to my outInterceptor.
>
> message.put("KEY", obj); //this only visible in the inInterceptors
>
> message.get("KEY"); //outInterceptor gets nothing since
> OutgoingChainInterceptor not propagating it.
>
>
> Thanks,
> -Vitaly
> -- 
> View this message in context: 
> http://www.nabble.com/How-to-pass-an-object-from-InInterceptor-to-outInterceptor-tp26000367p26000367.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 


Re: How-to pass an object from InInterceptor to outInterceptor

Posted by vickatvuuch <vl...@gmail.com>.
OK I figured this one out:

In the inInterceptor I put my object into this map and later looked it up in
the outInterceptor:

Map mem = (Map)message.getExchange();
mem.put("KEY", obj);

etc.



vickatvuuch wrote:
> 
> Hi All,
> 
> I'm trying to pass an object from my custom inInterceptor for my custom
> outInterceptor to pick up and write it to the reply header.
> 
> I tried setting it on the message inside an inInterceptor, but that
> doesn't make it to my outInterceptor.
> 
> message.put("KEY", obj); //this only visible in the inInterceptors
> 
> message.get("KEY"); //outInterceptor gets nothing since
> OutgoingChainInterceptor not propagating it.
> 
> 
> Thanks,
> -Vitaly
> 

-- 
View this message in context: http://www.nabble.com/How-to-pass-an-object-from-InInterceptor-to-outInterceptor-tp26000367p26001193.html
Sent from the cxf-user mailing list archive at Nabble.com.