When you use generics in Java, after you compile, all type information that you have provided in the source code is lost. It is called type erasure. It is only to help the compiler check your assumptions. The type info is not put in the class files. Thus, it cannot be extracted from compiled code. So, a Set<MyClass> is in fact just a Set<Object>.
 
Regards,
Suavi

Markus Plail <[EMAIL PROTECTED]> wrote:
Markus Plail <[EMAIL PROTECTED]>writes:
> I am using Hibernate in my web service. Hibernate uses java.util.Set
> for collections: private java.util.Set roles;
>
> I know I can't serialize Map and Set, but get arrays instead, which is
> fine for me, but I'd like to get RoleName[] instead of Object[]. Is
> this somehow possible?

I just realized that Java2WSDL is the culprit. At least I guess that it
is responsible for the wsdl I get when invoking
http://...:8080/service/blabla?wsdl So is there a possibility to not
generate a wsdl that corresponds to Object[] but MyClass[].
Perhaps there are other wsdl generators I could use?

regards
Markus


Reply via email to