我写了一个非常简单的webservice,它返回一个ArrayList。当我尝试使用SOAPUI测试我的Web服务时,响应是空的。我在Tomcat中部署这个应用程序。返回ArrayList的SOAP响应
这里是我的代码:
@WebService(endpointInterface = "com.enterprise.ws.WebServiceInterface")
public class WebServiceImpl implements WebServiceInterface{
@Override
public ArrayList<String> listSample() {
// TODO Auto-generated method stub
ArrayList<String> arrayList = new ArrayList<String>();
arrayList.add("1212");
return arrayList;
}
}
接口:
@WebService
@SOAPBinding(style = Style.RPC)
public interface WebServiceInterface {
@WebMethod
ArrayList<String> listSample();
}
这是我SOAPUI响应。
您是否尝试过其他任何方式,以确保您的服务能够按照您的要求工作,然后再说结果不符合预期? – Rao
是的,我有。我已经实现了3个其他方法来查看服务是否有错误,其他3个返回普通字符串的方法工作正常。 – Gowtham