コード例 #1
0
 /// <summary>
 /// Imprime los datos de autenticacion del log
 /// </summary>
 /// <param name="request"></param>
 private void PrintLoginValues(IMovilwayApiRequest request)
 {
     try
     {
         logger.InfoLow("[API] " + LOG_PREFIX + "[KinacuProvider] [INPUT] UserInfo {IP=" + HttpContext.Current.Request.UserHostAddress + ",Username="******"} " + request.ToString());
     }
     catch (Exception)
     {
         logger.InfoLow("[API] " + LOG_PREFIX + "[KinacuProvider] [INPUT] UserInfo {IP=" + "NULL" + ",Username="******"} " + request.ToString());
     }
 }
コード例 #2
0
        public IMovilwayApiResponse PerformOperation(IMovilwayApiRequest request)
        {
            try
            {
                LOG_PREFIX = HttpContext.Current.Session["LOG_PREFIX"].ToString() + "[" + new Random(DateTime.Now.Millisecond * 5).Next(100000000, 999999999) + "] ";
            }
            catch (Exception)
            {
                LOG_PREFIX = "";
            }

            UMarketSCClient      utibaClient = new UMarketSCClient();
            IMovilwayApiResponse response    = null;

            try
            {
                try
                {
                    logger.InfoLow("[API] " + LOG_PREFIX + "[UtibaProvider] [INPUT] UserInfo {IP=" + HttpContext.Current.Request.UserHostAddress + ",Username="******"} " + request.ToString());
                }
                catch (Exception)
                {
                    logger.InfoLow("[API] " + LOG_PREFIX + "[UtibaProvider] [INPUT] UserInfo {IP=" + "NULL" + ",Username="******"} " + request.ToString());
                }

                int timeOutSeconds = int.Parse(ConfigurationManager.AppSettings["DefaultTimeout"]);
                utibaClient.InnerChannel.OperationTimeout = new TimeSpan(0, 0, timeOutSeconds);

                String sessionID = null;
                if (!(request is GetSessionRequestBody))
                {
                    sessionID = GetSessionID(request);
                }

                response = PerformUtibaOperation(request, utibaClient, sessionID);

                logger.InfoLow("[API] " + LOG_PREFIX + "[UtibaProvider] [OUTPUT] " + response.ToString());
            }
            catch (Exception e)
            {
                logger.ErrorLow("[API] " + LOG_PREFIX + "[UtibaProvider] [EXCEPTION] Exception trying to serve UTIBA Operation {message=" + e.Message + ",stackTrace=" + e.StackTrace + "}");
            }

            return(response);
        }