EAS 构建ctx

栏目:eas cloud知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

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

可通过EASLoginSoapBindingStub.login进行登录获取session ,再通过LoginModuleFactory构建出ctx,代码如下 EASLoginProxyServiceLocator ...
点击下载文档
分享:
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息