使用POJO发布WebService时,遇到的第二个问题:wrong number of arguments
原因是 路径有问题,添加了 方法名就可以了。
原路径:http://localhost:8080/axis2/services/HelloService?name=bill
修改为:http://localhost:8080/axis2/services/HelloService/sayHello?arg0=bill
public class HelloService {
public String sayHello(String name) {
if (name == null || name.equals(""))
name = "nobody";
return "hello " + name;
}
}