Q:

soap webservices - return error message?

I have a little soap webservice. And I wonder how I can response with errors.
Eg:
public int createUser(String username) {
   //create...
   return id;
}

Now, if the user could not be created, how do I make a proper response? Do I have to throw a custom exception? Which is the right way?

A:

The correct approach here is to translate the exception into a SOAP Fault.

