当前位置:编程学习 > JAVA >>

webservice xfile客户端接收List的问题

我在服务端采用的是s2sh技术,客户端调用服务端返回的是一个List,但是对象不为空,里面的字段全为空,在服务端模拟一个客户端调用类,里面的List正常使用。
客户端代码如下,已经困扰我一个晚上了。
这是客户端和服务端分离的,如果都在客户端里面,可以正常使用
public static void main(String args[]){
//创建天气预报web服务的元数据
Service service = new ObjectServiceFactory().create(IGetWeather.class);
//创建web服务的代理
XFire xFile = XFireFactory.newInstance().getXFire();
XFireProxyFactory factory = new XFireProxyFactory(xFile);

//获取天气预报的web服务的地址
String url = "http://localhost:8080/ynhkservice/hw.ws";

IGetWeather ig = null;
try {
ig = (IGetWeather)factory.create(service, url);

} catch (MalformedURLException e) { 
e.printStackTrace();
}

                  //list对象不为空,但是里面的字段为空!!!
List<PCorpInfo> list = ig.searchByCarNo();

Iterator it = list.iterator();
while(it.hasNext()){
PCorpInfo pt = (PCorpInfo)it.next();
System.out.println(pt.getCorpAddr());
}

}
--------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- 不要用list改成对象数组
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,