You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Freeman Fang <fr...@gmail.com> on 2013/05/02 07:13:15 UTC

Re: Handle Message for interceptor getting called after the service method is called

Hi,

If you wanna TestInterceptor get invoked after the serviceimpl method is called, it should use Phase.POST_INVOKE phase.
-------------
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: @Freeman小屋

On 2013-4-30, at 上午3:36, remo408 wrote:

> Handle Message for interceptor getting called after the service method is
> called
> 
> <jaxws:endpoint id="service" implementor="#testServiceimpl"
>        address="/testService"> 
>     <jaxws:inInterceptors>
>            <bean id="test"
>        class="org.example.Test"/>
>     </jaxws:inInterceptors>
>     </jaxws:endpoint>
> 
> public class TestInterceptor extends AbstractSoapInterceptor {
> 
>    public TestInterceptor() {
>        super(Phase.INVOKE);
>    }
> 
> @Override
>    public void handleMessage(SoapMessage message) throws Fault {
>        System.out.println("Test");
> }
> }
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Handle-Message-for-interceptor-getting-called-after-the-service-method-is-called-tp5726932.html
> Sent from the cxf-user mailing list archive at Nabble.com.


Re: Handle Message for interceptor getting called after the service method is called

Posted by remo408 <pr...@gmail.com>.
Hi Daniel,

That resolved my issue.

Thanks For your help.



--
View this message in context: http://cxf.547215.n5.nabble.com/Handle-Message-for-interceptor-getting-called-after-the-service-method-is-called-tp5726932p5727520.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Handle Message for interceptor getting called after the service method is called

Posted by Daniel Kulp <dk...@apache.org>.
On May 3, 2013, at 10:45 AM, remo408 <pr...@gmail.com> wrote:

> HI Yue,
> 
> I want my interceptor to be called before my serviceimpl but with
> phase.Invoke the behavior looks different it is getting called after the
> serviceimpl call.

The call into the service is done by an interceptor that runs in the invoke phase.     Thus, your interceptor will be in the same phase and your interceptor may or may not be placed before the ServiceInvokerInterceptor.   My suggestion would be to move your interceptor up a phase  (PRE_INVOKE).     If you cannot, then in your constructor, do a:

addBefore(ServiceInvokerInterceptor.class.getName());



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


Re: Handle Message for interceptor getting called after the service method is called

Posted by remo408 <pr...@gmail.com>.
HI Yue,

I want my interceptor to be called before my serviceimpl but with
phase.Invoke the behavior looks different it is getting called after the
serviceimpl call.

Thanks,
remo.



--
View this message in context: http://cxf.547215.n5.nabble.com/Handle-Message-for-interceptor-getting-called-after-the-service-method-is-called-tp5726932p5727142.html
Sent from the cxf-user mailing list archive at Nabble.com.