Пример #1
0
        public object AfterReceiveRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel, System.ServiceModel.InstanceContext instanceContext)
        {
            //System.Diagnostics.Debug.WriteLine("AfterReceiveRequest => Thread ID : " + System.AppDomain.GetCurrentThreadId());
            try
            {
                _cookieContext = CallContext.GetData("__ArcheFxContext") as eBayHttpContext;
                if (_cookieContext == null)
                {
                    _cookieContext = new eBayHttpContext();
                    CallContext.SetData("__ArcheFxContext", _cookieContext);
                }
                if (_cookieContext.IsLogged())
                {
                    string[] roleArray = null;
                    List<string> roleList = new List<string>();
                    //룰을 추가한다면 아래서 불러와 추가
                    //roleList = new PermissionBiz().GetAdminRoleList(empNo);
                    roleList.Add("User");
                    roleArray = roleList.ToArray();

                    GenericIdentity identity = new GenericIdentity(_cookieContext.MemberId);
                    GenericPrincipal principal = new GenericPrincipal(identity, roleArray);
                    _cookieContext.Principal = principal;
                }

                System.Threading.Thread.CurrentPrincipal = _cookieContext.Principal;

            }
            // ToDo : Excepiton 정의 후 수정
            // WebOperationContext.Current.OutgoingResponse.SetStatusAsNotFound(); 등과 같이 수정

            catch (Exception ex)
            {
                throw ex;
            }

            return null;
        }
Пример #2
0
        public void BeforeSendReply(ref System.ServiceModel.Channels.Message reply, object correlationState)
        {
            try
            {
                _cookieContext.IsCookieExpired();
                System.Diagnostics.Debug.WriteLine("BeforeSendReply");
                CallContext.FreeNamedDataSlot("__ArcheFxContext");
                _cookieContext = null;
            }

            // ToDo : Excepiton 정의 후 수정
            catch (Exception ex)
            {
                throw ex;
            }
        }