Esempio n. 1
0
        /// <summary>
        /// Login to a Percussion sesession with the specified credentials and associated parameters.
        /// </summary>
        /// <param name="securitySvc">the proxy of the security service</param>
        /// <param name="user">The login user.</param>
        /// <param name="password">The login password.</param>
        /// <param name="community">The name of the Community into which to log the user</param>
        /// <param name="locale">The name of the Locale into which to log the user</param>
        /// <returns></returns>
        public static PSLogin Login(securitySOAP securitySvc, string user, string password, string community, string locale)
        {
            LoginRequest loginReq     = new LoginRequest();
            PSLogin      loginContext = null;

            try
            {
                loginReq.Username   = user;
                loginReq.Password   = password;
                loginReq.Community  = community;
                loginReq.LocaleCode = locale;

                // Setting the authentication header to maintain Rhythmyx session
                LoginResponse loginResp = securitySvc.Login(loginReq);
                loginContext = loginResp.PSLogin;
                securitySvc.PSAuthenticationHeaderValue         = new PSAuthenticationHeader();
                securitySvc.PSAuthenticationHeaderValue.Session = loginContext.sessionId;
            }

            catch (SoapException ex)
            {
                throw new CMSSoapException("Percussion Error in Login.", ex);
            }

            return(loginContext);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates and intialize a proxy of the Percussion service for maintaining
        /// login sessions.
        /// </summary>
        /// <param name="protocol">Communications protocol to use when connecting to
        /// the Percussion server.  Should be either HTTP or HTTPS.</param>
        /// <param name="host">Host name or IP address of the Percussion server.</param>
        /// <param name="port">Port number to use when connecting to the Percussion server.</param>
        /// <returns>An initialized proxy for the Percussion security service.</returns>
        public static securitySOAP GetSecurityService(string protocol, string host, string port)
        {
            securitySOAP securitySvc = new securitySOAP();

            securitySvc.Url = RewriteServiceUrl(securitySvc.Url, protocol, host, port);

            // create a cookie object to maintain JSESSION
            CookieContainer cookie = new CookieContainer();

            securitySvc.CookieContainer = cookie;

            return(securitySvc);
        }
Esempio n. 3
0
        /// <summary>
        /// Logs out from the Rhythmyx session.
        /// </summary>
        /// <param name="securitySvc">The security proxy.</param>
        /// <param name="rxSession">The Rhythmyx session.</param>
        public static void Logout(securitySOAP securitySvc, String rxSession)
        {
            LogoutRequest logoutReq = new LogoutRequest();

            try
            {
                logoutReq.SessionId = rxSession;
                securitySvc.Logout(logoutReq);
            }
            catch (SoapException ex)
            {
                throw new CMSSoapException("Percussion Error in Logout.", ex);
            }
        }