I would like to implement method overloading in the Java web service class as follows:
public String myMethod(User user)
{
// My code
}
public String myMethod(User[] user)
{
for(int i=0; i<user.length; i++)
{
myMethod(user[i]);
}
}
If I forward a single User
object to myMethod()
, it should trigger the first method and if I send an array of User
s, it should trigger the second method.
In the WSDL file it shows only a single method. However, if I try to call @WebMethod(operationName="")
for both calls, I am unable to generate the WSDL file.