总部老师,好:
在调用OSF接口取待办任务总数报错
Method failed: HTTP/1.1 404 Not Found
org.apache.commons.httpclient.HttpException: status: 404, request url: http://192.168.30.154:6888/shr/msf/service.do?method=callService&serviceName=getUnProcessAssignCount failed
at com.kingdee.shr.api.SHRClient.execute(SHRClient.java:206)
at com.kingdee.shr.api.SHRClient.execute(SHRClient.java:222)
at com.thinkgem.jeesite.modules.api.web.SsoLogController.getShrTask(SsoLogController.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
代码块如下:
@RequestMapping(value = "getShrTask")
public void getShrTask(HttpServletRequest request, HttpServletResponse response, Model model) {
//用户合法验证
String otUserName = request.getParameter("otUserName");
BmhSsoUser bmhSsoUser = new BmhSsoUser();
bmhSsoUser.setOtUserName(otUserName);
bmhSsoUser.setSysType("SHR");
Map map = new HashMap();
if(StringUtils.isEmpty(otUserName)){
map.put("ret", "Failture");
map.put("msg", "OA传递参数不正确");
this.renderString(response, map);
return ;
}
try {
Listrs = bmhSsoUserService.findList(bmhSsoUser);
if(rs==null || rs.size()==0){
map.put("ret", "Failture");
map.put("msg", "OA账号:"+otUserName+",未绑定SHR系统用户");
this.renderString(response, map);
return ;
}
bmhSsoUser = rs.get(0);
String pwd = bmhSsoUser.getPassword();
pwd = new String(BASE64Decoder.decodeBuffer(pwd));
WSContext ctx = proxy.login(bmhSsoUser.getK3UserName(), pwd, "eas", "shrcs", "L2", 2);
if(ctx==null || StringUtils.isEmpty(ctx.getSessionId())){
map.put("ret", "Failture");
map.put("msg", "用户名或密码不正确");
this.renderString(response, map);
return ;
}
//调用待办SOF
EASLoginProxyProxy proxy = new EASLoginProxyProxy();
SHRClient client = new SHRClient();
Token token = client.login(request);
Mapparameters = new HashMap();
///--报错的行
Response rp = client.execute(request, "getUnProcessAssignCount", parameters);
Object data = rp.getData();
map.put("ret", "Success");
map.put("tasks", data);
this.renderString(response, map);
} catch (IOException e) {
e.printStackTrace();
}
}