2 Replies Latest reply on Oct 9, 2009 2:36 AM by Sergey Chernov

    Using abstract classes in services: JBOSSWS Native stack

    Sergey Chernov Newbie

      Good day, All!


      I've got Q:
      Is it possiable for such code to work:

       public class A {
       ... getters/setters
       }
      
       public class B1 extends A {
       ... getters/setters
       }
      
       public class B2 extends A {
       ... getters/setters
       }
      
       @WebService
       public class SomeWebService {
      
       public B doIt(B value) {
      
       if (value instaceof B1) {
       ....
       return (B1)value
       }
       }
      
       }
      


      On the client and server sides I'm expecting that I get proper type cast.

      I've tried code above, but it doesn't work. Are there any trick? May be, somehow, I can use generic methods ? May be there are special annotation to say wsprovide/wsconsume what types should service expect and return ?

      Thanks in advance for your answer.