Hi,
I found a lot of references to this but no clear explanation or solution:
A simple application exception seems mapped to WSDL faults without problems.
But if I want my jaxws service to throw exceptions of some subclass hierarchy,
then the WSDL does not reflect that hierarchy in the fault types (and the
generate client code does not either). They will appear as unrelated faults, so
the client code cannot use the exception hierarchy for dealing with errors in
the catch blocks.
Example, if I want the following then what is the right way of doing this in
JAXWS? And: where is this specified in the specs or docs?
SERVER:
@WebService
public class MyService {
public void doIt() throws MyException {
throw new MySubException();
}
}
public class MyException extends Exception {
}
public class MySubException extends MyException {
}
CLIENT:
try {
service.doIt();
} catch (MySubException specificError) {
//...
} catch (MyException generalError) {
//...
}
Thanks
Guy