You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Henrik Schmidt-Møller <sm...@daimi.au.dk> on 2005/07/22 21:08:28 UTC

Creatings stubs. Generics problem.

Ok, I am a total newbie in the wonderful world of webservices, but 
someone told me that using Axis was as easy as pie. Generally, that 
seems to be true, but I ran into an annoying problem.

I want to publish a method that returns a List of javabeans. I use the 
standard BeanSerializer and BeanDeserializer. On the clientside, 
WSDL2Java will be used to generate stubs.

The problem seems to be that Java generics does not appear to be fully 
supported. In other words, this works:

public class SomeService {
    
    public SomeBean getBean( ... ) { ... }

    public List<SomeBean> getBeanList() { ... }
}


However, this does not work:

public class SomeService {

    public List<SomeBean> getBeanList() { ... }
}

If there is no method that explicitly returns SomeBean the SomeBean.java 
"stub" is not generated.

Now, the obvious choice would be to have getBeanList return someBean[] 
instead, but I happen to like generics :)

So, the questions are these: Is there neat way out of this problem? If 
not, will it be supported in a future version of Axis? If so, when?

Best Regards,
  Henrik