コード例 #1
0
        public UploadAppSession RunSample(GenericApplication sample)
        {
            var session = new UploadAppSession {
                Request = sample
            };

            try
            {
                var watch = Stopwatch.StartNew();
                session.Response = _terrasoftProxy.UploadApplication(session.Request, ConfigurationManager.AppSettings["TerrasoftSvcPass"]);
                watch.Stop();

                session.TimeToPerform = watch.Elapsed;
            }
            catch (Exception ex)
            {
                if (session.Response == null)
                {
                    session.Response = new Response();
                }

                session.Response.IsSuccess    = false;
                session.Response.ErrorMessage = ex.ToString();
            }

            SendToStorageService(session);

            return(session);
        }
コード例 #2
0
        private void SendToStorageService(UploadAppSession session)
        {
            var badReq = new ServiceSiteBadReq
            {
                date        = DateTime.Now,
                productType = session.ApplicationType.ToString(),
                productCode = session.BankingService,
                phoneNumber = session.PhoneNumber,
                ErrorInto   = String.Format("{0}:{1}", session.TimeToPerform, session.ResponseMsg),
                formID      = session.SmsCode,
                host        = "Test",
                request     = session.GetRequest(),
                IsIntoOk    = session.ResponseOk,
                NumberStep  = Convert.ToInt32(GlobalRegistry.Objects["ThreadNum"]), // hardly incorrect to put it here so lame solution
            };

            session.IsSessionSavedToStorage = _servicesiteProxy.BadRequest(ConfigurationManager.AppSettings["StorageSvcPass"], badReq);
        }