2 Replies Latest reply on Feb 10, 2009 6:50 AM by Alessio Soldano

    WeFault and throws declaration

    Kamil Demecki Novice


      I have that structure

      @WebFault public class BaseAppException {
       ExceptionXBVO getFaultInfo() { ...}
      @WebFault public class OtherAppException extends BaseAppException {
       ExceptionXBVO getFaultInfo() { super.getFa...}
      public interface IServiceOne {
       @WebMethod public String one(@WebParam("xxx" xxx) throws BaseAppException;
      @WebService [...other annotations...] public class SerwiceOne implements IServiceOne {
       @WebMethod public String one(@WebParam("xxx" xxx) throws BaseAppException {
       throw new OtherAppException("info");

      If web service declare BaseAppException but method throws OtherAppException which inherit on it. Should JBoss WS throw SOAPFaultException or OtherAppException or BaseAppException ?

      I think best solution is to catch OtherAppException by client but in my config is catched SOAPFaultException. When I add OtherAppException to throws declaration then is works as excepted. Does JBoss WS require adding to throws decalarion all possible exception, iheritance doesn't enough ?