You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "zsolt.szloboda" <zs...@gmail.com> on 2014/07/27 22:56:23 UTC

Message.INBOUND_MESSAGE in PREPARE_SEND_ENDING Interceptor

I have a CXF service, which is also a WS client of other services

I have a PREPARE_SEND_ENDING Interceptor configured in my service
(which is invoked both when sending a request as a client,
and when returning a response as a server;
so it is invoked twice)

in the interceptor I would like to figure out
which of these two invocations is the current invocation

I thought I could use the Message's INBOUND_MESSAGE attribute
(which is a Boolean);
to my surprise, it returns NULL, when returning the response as server
(and returns false, when sending the request as a client)

isn't it a bug in CXF, that the Message's INBOUND_MESSAGE attribute is NULL?
or am I missing something?




--
View this message in context: http://cxf.547215.n5.nabble.com/Message-INBOUND-MESSAGE-in-PREPARE-SEND-ENDING-Interceptor-tp5746968.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Message.INBOUND_MESSAGE in PREPARE_SEND_ENDING Interceptor

Posted by Daniel Kulp <dk...@apache.org>.

For this use case, I’d suggest using the MessageUtils.isRequestor(msg) call.

Dan


On Jul 27, 2014, at 4:56 PM, zsolt.szloboda <zs...@gmail.com> wrote:

> I have a CXF service, which is also a WS client of other services
> 
> I have a PREPARE_SEND_ENDING Interceptor configured in my service
> (which is invoked both when sending a request as a client,
> and when returning a response as a server;
> so it is invoked twice)
> 
> in the interceptor I would like to figure out
> which of these two invocations is the current invocation
> 
> I thought I could use the Message's INBOUND_MESSAGE attribute
> (which is a Boolean);
> to my surprise, it returns NULL, when returning the response as server
> (and returns false, when sending the request as a client)
> 
> isn't it a bug in CXF, that the Message's INBOUND_MESSAGE attribute is NULL?
> or am I missing something?
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Message-INBOUND-MESSAGE-in-PREPARE-SEND-ENDING-Interceptor-tp5746968.html
> Sent from the cxf-user mailing list archive at Nabble.com.

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