1 Reply Latest reply on Aug 7, 2009 4:18 PM by Soheil Hassas Yeganeh

    Abstract Classes and JAXB context in JBossWS

    Soheil Hassas Yeganeh Newbie

      Hi All,

      Suppose there is an abstract class A with a derived concrete class B:

      public abstract class A {
      ...
      }
      
      public class B extends A{
      }
      


      Also suppose we have a web service that returns A in it method prototype and return an instance of B

      @WebService
      ....
      class Test {
      
      public A testMethod(A a){
      a.doSomething();
      return new B();
      }
      }
      


      As JAXWS uses the interface to generate the WSDL and also the JAXB context, there is no "B" in neither the JAXB context nor the WSDL file.
      So, when the testMethod is invoked, the instantiation exception will be fired because A is abstract!

      I would like to know if there exists any extension mechanism to the JAXB context creation mechanism in JBossWS, or any work around to put the B class into the context and the generated WSDL !

      Bests,
      Soheil Hassas Yeganeh