本人维护公司以前的一个项目,这个项目要调用另外一个项目的单点登录接口。代码如下: String AuthServiceUrl = "http://portal.gf.com.cn/app/GFNotification/restful/GFCommonService/";// 用户身份校验API地址 try { ClientConfig config = new DefaultClientConfig(); Client client = Client.create(config); WebResource service = client.resource(AuthServiceUrl); ClientResponse response = service.path("mixModeUserLoginAuth/ccbm/ccbm/lihl/a123456") .type(MediaType.APPLICATION_XML_TYPE).accept(MediaType.APPLICATION_XML).get(ClientResponse.class); RestfulResult erprs = response.getEntity(RestfulResult.class); System.out.println("CALL Result:" + erprs.isSuccess()); System.out.println("CALL Result Msg:" + erprs.getMsg()); } catch (Exception e) { System.out.println(e); }问题:上面这段代码要用到哪些jar包?本人已经引用如下jar包,如下图所示:报错信息如下:APPLICATION_XML_TYPE cannot be resolved or is not a fieldRestfulResult cannot be resolved to a type请大神赐教,感激不尽!问题:上面这段代码错在哪里,我是否引用错了jar包?问题1:如果不考虑引入jar包版本问题,会不会出现各个依赖jar版本不兼容报错问题?问题2:通常应该去哪里找项目需要的jar?因为,我觉得根据项目代码去百度搜索jar效率太低,容易出错。
添加回答
举报
0/150
提交
取消