Thanks Dan. That helps. 

-----Original Message-----
From: Daniel Kulp [mailto:[email protected]] 
Sent: Monday, March 30, 2009 3:12 PM
To: [email protected]
Cc: Morgan Rachell
Subject: Re: Interceptors

On Mon March 30 2009 1:02:19 pm Morgan Rachell wrote:
> 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?

The inFaults are the interceptors on the client side for fault handling
(when 
the fault comes "in" from the server).    The outFaults are for the
outgoing 
faults on the server side.  


> 2)      Is there a "catch-all" interceptor that acts like a "finally"
> block? 

No.   You would need to put it on both the chains.  (and on both the
"in" 
chains on the client side).

Dan


> 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

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to