微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

axis 客户端调用CXF的webservice

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") 的异常

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐