Ejemplo n.º 1
0
        /// <summary>
        /// Update a user password in the EJS.
        /// </summary>
        public static void UpdateUserPassword(
            string UserName, string OldPassword, string NewPassword)
        {
            EjsPublicServiceClient _client = null;

            try
            {
                _client = new EjsPublicServiceClient();
                _client.Endpoint.Address = new EndpointAddress(ejsBridgeManager.EjsAddress);
                _client.UpdateUserPassword(UserName, OldPassword, NewPassword);
            }
            catch (FaultException <ejsFailureReport> ex)
            {
                throw new ApplicationException(ex.Detail._header + "\n" + ex.Detail._originalException.Message);
            }
            catch (Exception)
            {
                throw new ApplicationException("EJSと接続する際に失敗しました。");
            }
            finally
            {
                if (_client != null)
                {
                    _client.Close();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Update a user password in the EJS.
        /// </summary>
        public static void UpdateUserPassword(
            string UserName, string OldPassword, string NewPassword)
        {
            EjsPublicServiceClient _client = null;

            try
            {
                _client = new EjsPublicServiceClient();
                _client.Endpoint.Address = new EndpointAddress(ejsBridgeManager.EjsAddress);
                _client.UpdateUserPassword(UserName, OldPassword, NewPassword);
            }
            catch (FaultException <ejsFailureReport> ex)
            {
                throw new ApplicationException(ex.Detail._header + "\n" + ex.Detail._message);
            }
            //	let's do not translate arbitrary exception to AppicationException here.
            //catch (Exception)
            //{
            //	throw new ApplicationException(Properties.Resources.EX_EjsConnectionFailed);
            //}
            finally
            {
                if (_client != null)
                {
                    _client.Close();
                }
            }
        }