[jboss-user] [JBoss Web Services Users] - Using abstract classes in services: JBOSSWS Native stack

chernser do-not-reply at jboss.com
Thu Oct 8 05:35:44 EDT 2009


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. 

 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259308#4259308

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259308



More information about the jboss-user mailing list