cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Handling Exceptions in Apache CXF
Date Thu, 03 Nov 2011 15:24:09 GMT

I'm using the CXF for developing webservices.

But I was wondering what is Best Practice for handling exceptions? Let's say
I have a webservice-operation, create(User user).
 The incoming user is an instance of my User domain class, and can be saved
directly by  the UI Team by calling 

If the save() for some reason fail (e.g. some Network connectivity  fail ,
or some data validation error from User DTO ), how would Best Practice
dictate that I serve this exception to the client? 

I mean: Which type of Exception would be suitable? 

Should this Exception be included in the operations signature ??

public Response createUser(User user);

public interface EmpService {
public Response createUser(User user);

And how should the client-side handle this exception? 

View this message in context:
Sent from the cxf-user mailing list archive at

View raw message