欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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);