You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Nishant Chandra <ni...@gmail.com> on 2012/11/26 07:08:03 UTC

CXF interceptor

Hi,

I have CXF web service A that calls another CXF web service B. An IN
interceptor is defined which intercepts the incoming requests on service B.

The interceptor is also called on the client in A when the response is
returned and which is not needed in my cases.

What can I do to prevent the interceptor to run when the response is
returned in service A?

I explored an alternative wherin I can parse the message in handleMessage
to see the response code is null or not.But i wanted to do it more
efficiently to not even call the interceptor, as it will parse the whole
message, which is not required in my case.

Thanks,
Nishant

Re: CXF interceptor

Posted by Glen Mazza <gm...@talend.com>.
Here's some code samples for attaching interceptors: 
http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors.

HTH,
Glen

On 11/26/2012 01:12 AM, Freeman Fang wrote:
> Hi,
>
> How you add IN interceptors for serviceB? I guess you add it on a global bus which is shared by client in A and serviceB, right?
> If you add it directly on serviceB endpoint only, then it would get invoked only for serviceB.
>
> Freeman
> -------------
> Freeman(Yue) Fang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://fusesource.com | http://www.redhat.com/
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
>
> On 2012-11-26, at 下午2:08, Nishant Chandra wrote:
>
>> Hi,
>>
>> I have CXF web service A that calls another CXF web service B. An IN
>> interceptor is defined which intercepts the incoming requests on service B.
>>
>> The interceptor is also called on the client in A when the response is
>> returned and which is not needed in my cases.
>>
>> What can I do to prevent the interceptor to run when the response is
>> returned in service A?
>>
>> I explored an alternative wherin I can parse the message in handleMessage
>> to see the response code is null or not.But i wanted to do it more
>> efficiently to not even call the interceptor, as it will parse the whole
>> message, which is not required in my case.
>>
>> Thanks,
>> Nishant
>


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: CXF interceptor

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

How you add IN interceptors for serviceB? I guess you add it on a global bus which is shared by client in A and serviceB, right?
If you add it directly on serviceB endpoint only, then it would get invoked only for serviceB.

Freeman
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-11-26, at 下午2:08, Nishant Chandra wrote:

> Hi,
> 
> I have CXF web service A that calls another CXF web service B. An IN
> interceptor is defined which intercepts the incoming requests on service B.
> 
> The interceptor is also called on the client in A when the response is
> returned and which is not needed in my cases.
> 
> What can I do to prevent the interceptor to run when the response is
> returned in service A?
> 
> I explored an alternative wherin I can parse the message in handleMessage
> to see the response code is null or not.But i wanted to do it more
> efficiently to not even call the interceptor, as it will parse the whole
> message, which is not required in my case.
> 
> Thanks,
> Nishant