I have two questions about interceptors:

 

1)      What is the difference between when an inFaultInterceptor and an
outFaultInterceptor get called? For example, if I receive a message on a
jaxws:endpoint, a business object does some processing as a result, then
that throws some exception based on business rules (e.g. data integrity
issue, user not authorized, etc. ) how does CXF know which
faultInterceptor to call?

2)      Is there a "catch-all" interceptor that acts like a "finally"
block? I want to execute some code after every message completes
processing, regardless of whether a fault occurred or not. Right now it
looks like I need to include my interceptor in the outInterceptor and
outFaultInterceptor chains like this:

 

      <jaxws:endpoint id="myEndpoint" implementor="#endpointService"
address="/soap/endpoint">

            <jaxws:features>

                  <bean class="org.apache.cxf.feature.LoggingFeature"/>

            </jaxws:features>

            <jaxws:inInterceptors>

                     <ref bean="myInInterceptor"/>

            </jaxws:inInterceptors>

            <jaxws:outInterceptors>

                  <ref bean="myCatchAllInterceptor" /> 

            </jaxws:outInterceptors>

            <jaxws:outFaultInterceptors>

                  <ref bean=" myCatchAllInterceptor" /> 

            </jaxws:outFaultInterceptors>

      </jaxws:endpoint>

 

Thanks,
Morgan

 

Reply via email to