xife webservice 解决调用的方法里面的参数有数组的问题 博客分类: 工作
程序员文章站
2024-02-04 16:50:52
...
1.不能用下面的方法,client候不能传递复杂类型,用factory映射的方式可以
Client client = new Client(new URL("http://127.0.0.1:8081/lwdsp/services/DataExchangeList?wsdl"));
List<String> s = new ArrayList<String>();
s.add("2");
s.add("3");
Object[] results1 = client.invoke("doExchangeUser", new Object[] { "11","2",s.toArray() });
2.factory方法
Service srvcModel = new ObjectServiceFactory().create(IDataExchangeService.class);
XFireProxyFactory factory = new XFireProxyFactory(XFireFactory.newInstance().getXFire());
String helloWorldURL = "http://127.0.0.1:8081/lwdsp/services/DataExchangeList";
IDataExchangeService srvc = (IDataExchangeService) factory.create(srvcModel, helloWorldURL);