cxf-users mailing list archives

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

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  user.save() 

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);

@WebService
public interface EmpService {
public Response createUser(User user);
}

And how should the client-side handle this exception? 

--
View this message in context: http://cxf.547215.n5.nabble.com/Handling-Exceptions-in-Apache-CXF-tp4961369p4961369.html
Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message