EAS 构建ctx
可通过EASLoginSoapBindingStub.login进行登录获取session ,再通过LoginModuleFactory构建出ctx,代码如下
EASLoginProxyServiceLocator locator = new EASLoginProxyServiceLocator();
URL url = new URL("http://127.0.0.1:56898/ormrpc/services/EASLogin");
EASLoginSoapBindingStub soap = new EASLoginSoapBindingStub(url, locator);
WSContext ctx = soap.login(
"18274509996", "Gpy2763218@", "eas","test01","L2", 0
);
String sessionId = ctx.getSessionId();
private static Context getContextBySessionID(String sessionid) {
ILoginModule loginModule = null;
Context ctx = null;
try {
if ("true".equals(System.getProperty("remoteMode"))) {
LoginUtil.initRpcConfig(ctx, sessionid);
loginModule = LoginModuleFactory.getRemoteInstance();
ctx = loginModule.getContextBySessionID(sessionid);
} else {
loginModule = LoginModuleFactory.getLocalInstance(null);
ctx = loginModule.getContextBySessionID(sessionid);
LoginUtil.initRpcConfig(ctx, sessionid);
}
} catch (Exception e) {
e.printStackTrace();
}
return ctx;
}
EAS 构建ctx
本文2024-09-16 22:09:35发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-46300.html