A simple interceptor at the beginning of the  FaultOutChain on the server side 
can grab the exception from the Message, log it, and replace that exception 
with a new Exception with a new message. 

Dan



On Sep 19, 2013, at 6:10 AM, James Green <[email protected]> wrote:

> We have a Spring XML-config powered application that includes a CXF powered
> JAX-WS service.
> 
> The trouble is, the service currently intercepts RuntimeExceptions and
> throws them as SoapFaultException with the message passed through. This may
> be the spec, but it's certainly not helpful to us.
> 
> So I'd like to change this behaviour thus:
> 
> 1. I want to log the fault on the server
> 2. I want SoapFaultException messages to read more along the lines of
> "Temporary fault. Please try again later."
> 
> I really don't want us airing dirty laundry like database connection faults
> or SQL faults in public. Unfortunately, catching Exception inside our
> service methods does not work.
> 
> So reading around CXF has interceptors. What I don't see is how to use this
> to override the default behaviour. Is there a tutorial that I'm missing?
> 
> I'm having trouble imagining this default behaviour is desired by many
> companies so I'm slightly surprised this isn't a hot topic...
> 
> TIA
> 
> JAmes

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to