public void BeforeSendReply(ref Message reply, object correlationState)
        {
            string ModuleName = "ChannelProxyInspector";
            string MethodName = "BeforeSendReply";

            string replyString = reply.ToString();
            string sessionID   = (string)correlationState;

            NCR.EAI.Log.MessageLogger msgLogger = new NCR.EAI.Log.MessageLogger();
            MessageLog _messageLog = new MessageLog();

            _messageLog.IN_OUT = MessageLog.INOUT.IN_RES.GetHashCode();

            _messageLog.NETWORK_ID = ConfigurationManager.AppSettings["IVR_NETWORK_ID"].ToString(); //this can be channel proxy Network ID

            msgLogger.updateSoapResponseMsgLog(ref reply, ref _messageLog);
            //string sessionid = channel.SessionId.ToString();
            Logger.logDebug(ModuleName, MethodName, "SessionID [" + sessionID + "]", Logger.LOGLEVEL.INFO);
            if (Convert.ToBoolean(ConfigurationManager.AppSettings["LOG_MESSAGE"].ToString()))
            {
                string pattern  = @"\b(?:(4|5)([0-9]{1})([0-9]{4})([0-9]{6})([0-9]{4}))\b";
                string MASKCARD = "$1$2$3******$5";
                string DebugMsg = Regex.Replace(replyString, pattern, MASKCARD);

                Logger.logDebug(ModuleName, MethodName, "SessionID [" + sessionID + "] Reply Message: " + DebugMsg, Logger.LOGLEVEL.INFO);
            }
        }
Exemplo n.º 2
0
        public void AfterReceiveReply(ref System.ServiceModel.Channels.Message reply, object correlationState)
        {
            string ModuleName = "AUBMessageInspector";
            string MethodName = "AfterReceiveReply";

            string replyString = reply.ToString();
            string sessionID   = (string)correlationState;

            NCR.EAI.Log.MessageLogger msgLogger = new NCR.EAI.Log.MessageLogger();
            MessageLog _messageLog = new MessageLog();

            _messageLog.IN_OUT     = MessageLog.INOUT.OUT_RES.GetHashCode();
            _messageLog.SESSION_ID = sessionID;
            _messageLog.NETWORK_ID = ConfigurationManager.AppSettings["AUB_OIS_NETWORK_ID"].ToString();

            msgLogger.updateSoapResponseMsgLog(ref reply, ref _messageLog);

            //throw new NotImplementedException();
            //System.Windows.Forms.MessageBox.Show(reply.WriteMessage()
            if (Convert.ToBoolean(ConfigurationManager.AppSettings["LOG_AUB_MESSAGE"].ToString()))
            {
                string pattern  = @"\b(?:(4|5)([0-9]{1})([0-9]{4})([0-9]{6})([0-9]{4}))\b";
                string MASKCARD = "$1$2$3******$5";
                string DebugMsg = Regex.Replace(replyString, pattern, MASKCARD);

                Logger.logDebug(ModuleName, MethodName, "Reply Message: " + DebugMsg, Logger.LOGLEVEL.INFO);
            }
            try
            {
                Logger.logDebug(ModuleName, MethodName, "Is Fault: " + reply.IsFault.ToString(), Logger.LOGLEVEL.INFO);
            }
            catch
            {
            }
        }