Hi,

Do you speak about JAX-RS or JAX-WS service?
In former case it is possible to achieve that with Exception Mapper. For JAX-WS 
you likely need to write own interceptor and put it into fault chain.

Regards,
Andrei.

> -----Original Message-----
> From: Al Eridani [mailto:[email protected]]
> Sent: Montag, 10. Februar 2014 19:49
> To: [email protected]
> Subject: Automatic exception conversion?
> 
> Hello, all my web service methods follow the same pattern:
> 
> public ... someMethod() throws MyWebServicesFault {
>     try {
>       ...
>     } catch (Exception e) {
>       throw new MyWebServicesFault(e);
>     }
>   }
> 
> Is it possible to simplify them by eliminating the try/catch and somehow tell 
> the
> CXF framework to catch any exception thrown and to wrap it into my custom
> MyWebServicesFault?
> 
> I'm using 2.6.2, if it matters.
> 
> Thanks!

Reply via email to