Java Webservice with generic methods
Posted
by danby
on Stack Overflow
See other posts from Stack Overflow
or by danby
Published on 2010-05-19T09:34:56Z
Indexed on
2010/05/19
12:50 UTC
Read the original article
Hit count: 217
Hi,
I was wondering if it is possible to make a generic webservice method in java like this:
@WebMethod
public <T extends Foo> void testGeneric(T data){
However when I try to consume this with a Java client I get an error stating:
[ERROR] Schema descriptor {http://####/}testGeneric in message part "parameters" is not defined and could not be bound to Java.
I know it is possible to make a method that takes a parameter such as List and this generates correctly using JAX-WS.
I don't mind if there is a solution that means I am tied to using only a particular technology.
Thanks, Dan.
© Stack Overflow or respective owner