加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

axis 客户端调用CXF的webservice

发布时间:2020-12-17 00:38:17 所属栏目:安全 来源:网络整理
导读:Service service = new Service(); ? Call call = (Call) service.createCall(); ? call.setTargetEndpointAddress("http://localhost:8080/axis/services/CrSupportWebService"); ? call.setOperationName("getAttInfo"); ? call.addParameter("text",XMLTy
Service service = new Service(); ? Call call = (Call) service.createCall(); ? call.setTargetEndpointAddress("http://localhost:8080/axis/services/CrSupportWebService"); ? call.setOperationName("getAttInfo"); ? call.addParameter("text",XMLType.XSD_STRING,ParameterMode.IN); ? call.setReturnType(XMLType.XSD_STRING); ? CrSupportTest test = new CrSupportTest(); JSONArray jsonArray = new JSONArray();? test.setResult("1"); test.setModel("0"); test.setClientName("test_client"); jsonArray.add(test); ? System.out.println(call.invoke(new Object[] { jsonArray.toString()})); 接口 @WebService public interface CrSupportWebService { ??? ??? String getAttInfo(@WebParam(name="text")String inputJson); ??? ??? String upload(DataHandler handler,String fileName,String no); } 接口需要声明WebParam,不然会报Unmarshalling Error: unexpected element (uri:"",local:"text") 的异常

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读