您的位置:首页 > 其它

XFIRE 客户端 传递参数是对象 传递参数的对象所在包路径必须和服务端包路径一样。不然就出现传递过去对象值为空。

2013-05-27 13:23 363 查看
public static void main(String[] args) {

Service srvcModel=new ObjectServiceFactory().create(IXzspApplyItem.class);

XFireProxyFactory factory = new XFireProxyFactory(XFireFactory.newInstance().getXFire());
String url="http://192.168.1.165:8090/xzspweb/services/XzspApplyItem";
try {

IXzspApplyItem xzspApplyItem=(IXzspApplyItem)factory.create(srvcModel,url);
String str =xzspApplyItem.HelloServices("service");
System.out.println(str);

XzspApplyItemPart xp=new XzspApplyItemPart();
xp.setItemId(30509l);
xp.setItemName("想");
Date a=new Date();
//xp.setApplyDate(applyDate);
xp.setUserId(696666l);
xp.setGroupId("99999") ;
xp.setApplyNo("99999") ;
xp.setStatus("99999") ;
xp.setTjGroupId("99999");
boolean ss= xzspApplyItem.saveXzspApplyItem(xp);

System.out.println(ss);
} catch (Exception e) {

e.printStackTrace();
}
}


上面代码为客户端测试代码。

要根据服务端提供的方法写接口类。
注意传递参数的对象所在包路径必须和服务端包路径一样。不然就出现传递过去对象值为空。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐