凭证的引入设置安全模式
767次浏览
编辑于2019年04月24日 15:03:52
修改eas\Server\eas\server\profiles\server1\config\webservice.propetties文件 isRomoteLocate=false修改参数后,webservice调用端需要把登录返回的session传过去,java调用示例如下,其它语言调用参考 [table]
[tr][td=600] EASLoginProxy proxy =null;
WSContext context = null;
try {
//登录
proxy = new EASLoginProxyServiceLocator().getEASLogin();
context= proxy.login("kdjgf", "", "eas", "zs70sp5", "l2", 1);
//具体业务调用
String[][] vouchers= null;
WSGLWebServiceFacadeSrvProxy proxyWS= null;
proxyWS = new WSGLWebServiceFacadeSrvProxyServiceLocator().getWSGLWebServiceFacade();
//设置登录返回的session在soap头
((Stub) proxyWS).setHeader("http://login.webservice.bos.kingdee.com","SessionId", context.getSessionId());
vouchers = proxyWS.getVoucher("001", "2008", "5", 0, 0);
} catch (ServiceException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
[table]
[tr][td=600] EASLoginProxy proxy =null;
WSContext context = null;
try {
//登录
proxy = new EASLoginProxyServiceLocator().getEASLogin();
context= proxy.login("kdjgf", "", "eas", "zs70sp5", "l2", 1);
//具体业务调用
String[][] vouchers= null;
WSGLWebServiceFacadeSrvProxy proxyWS= null;
proxyWS = new WSGLWebServiceFacadeSrvProxyServiceLocator().getWSGLWebServiceFacade();
//设置登录返回的session在soap头
((Stub) proxyWS).setHeader("http://login.webservice.bos.kingdee.com","SessionId", context.getSessionId());
vouchers = proxyWS.getVoucher("001", "2008", "5", 0, 0);
} catch (ServiceException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
[table]
推荐阅读