示例#1
0
        public Session Logon(string loginUrl, string user, string password, string organization)
        {
            var sessionClient = clientFactory.CreateLoginSessionClient(loginUrl);

            TwinfieldLoginSessionService.LogonResult logonResult;
            TwinfieldLoginSessionService.LogonAction logonAction;
            string clusterUrl;
            var    sessionHeader = sessionClient.Logon(user, password, organization, out logonResult, out logonAction, out clusterUrl);

            if (logonResult != TwinfieldLoginSessionService.LogonResult.Ok)
            {
                return(null);
            }

            if (logonAction != TwinfieldLoginSessionService.LogonAction.None)
            {
                return(null);
            }

            return(new Session
            {
                SessionId = sessionHeader.SessionID,
                ClusterUrl = clusterUrl
            });
        }