Axis下WebService的调用问题,急!!!
本人按照网上例子制作一个Sample,遇到一个问题,当用JAVA编写的客户端调用返回值类型是int的函数时能正确得到返回值,但是调用返回值类型是String的函数时,不能正确得到返回值。请高手指教!
以下为服务器端程序源代码:
/**
* 此处插入类型描述。
* 创建日期:(2005-10-27 10:32:48)
* @author:Administrator
*/
import java.util.*;
public class ZxjTest {
protected String name="gaga";
protected int age=20;
protected int sex=22;
protected List items=new ArrayList();
/**
* ZxjTest 构造子注解。
*/
public ZxjTest() {
super();
}
public String getName()
{
return name;
}
public int getAge()
{
return age;
}
public int getSex()
{
return sex;
}
public List getItems()
{
return items;
}
}
客户端调用的源代码:
String endpoint = "http://myserver:7001/ZxjTest.jws";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("getName");
String ret = (String) call.invoke(new Object[] {});
出错的就是最后一句。如果这一句改成调用返回值是Int的函数,就不会出错。
请问,这是Axis的配置的问题吗?如果是,该如何改?请赐教!