public BaseResponse Ping()
        {
            methodName = "Ping";

            try
            {
                PingRequest request = new PingRequest();
                baseResponse = Heartbeat.Ping(request);
            }
            catch (Exception ex)
            {
                baseResponse = new BaseResponse();
                FatalErrorResponse fatalError = new FatalErrorResponse();
                baseResponse.TypedResponse = fatalError;
                Message error = new Message("UnknownException");
                baseResponse.DebugStringLog.Add(ex.TargetSite.Name);
                baseResponse.DebugStringLog.Add(ex.Message);
                baseResponse.DebugStringLog.Add(ex.StackTrace);
                baseResponse.Messages.Add(error);

                LogMethodError(methodName, ex);
            }

            return(baseResponse);
        }
        public BaseResponse Ping()
        {
            methodName = "Ping";
            
            try
            {
                PingRequest request = new PingRequest();
                baseResponse = Heartbeat.Ping(request);
            }
            catch (Exception ex)
            {
                baseResponse = new BaseResponse();
                FatalErrorResponse fatalError = new FatalErrorResponse();
                baseResponse.TypedResponse = fatalError;
                Message error = new Message("UnknownException");
                baseResponse.DebugStringLog.Add(ex.TargetSite.Name);
                baseResponse.DebugStringLog.Add(ex.Message);
                baseResponse.DebugStringLog.Add(ex.StackTrace);
                baseResponse.Messages.Add(error);

                LogMethodError(methodName, ex);
            }
            
            return baseResponse;
        }
Beispiel #3
0
        private static BaseResponse GetResponse(Methods methodCalled, PingRequest ahRequest)
        {
            string       className    = "SFGWrapper.Heartbeat";
            BaseResponse baseResponse = new BaseResponse();

            try
            {
                using (HeartbeatService svc = new HeartbeatService())
                {
                    svc.Timeout     = 20000;
                    svc.Credentials = new System.Net.NetworkCredential(ahRequest.ServiceUsername, ahRequest.ServicePassword);
                    argtype sfgRequest = HeartbeatTranslators.TranslateToSfgRequest(ahRequest);
                    switch (methodCalled)
                    {
                    case Methods.PING:
                        baseResponse = HeartbeatTranslators.Ping(svc.process_wsdl(sfgRequest));
                        break;
                    }
                }
                if (baseResponse == null)
                {
                    baseResponse = new BaseResponse();
                    FatalErrorResponse fatalError = new FatalErrorResponse();
                    baseResponse.TypedResponse = fatalError;
                    baseResponse.Messages.Add(new Message("SFGFatalError"));
                }
            }
            catch (Exception ex)
            {
                baseResponse = new BaseResponse();
                FatalErrorResponse fatalError = new FatalErrorResponse();
                baseResponse.TypedResponse = fatalError;
                Message error = new Message("UnknownException");
                baseResponse.DebugStringLog.Add(ex.TargetSite.Name);
                baseResponse.DebugStringLog.Add(ex.Message);
                baseResponse.DebugStringLog.Add(ex.StackTrace);
                baseResponse.Messages.Add(error);
                EventLogger.LogError(string.Format("{0}.{1}()", new object[] { className, methodCalled.ToString() }),
                                     string.Format("Message: {0} \r\nStackTrace: {1}", ex.Message, ex.StackTrace));
            }
            return(baseResponse);
        }
Beispiel #4
0
        private static BaseResponse GetResponse(Methods methodCalled, PingRequest ahRequest)
        {
            string className = "SFGWrapper.Heartbeat";
            BaseResponse baseResponse = new BaseResponse();
            try
            {
                using (HeartbeatService svc = new HeartbeatService())
                {
                    svc.Timeout = 20000;
                    svc.Credentials = new System.Net.NetworkCredential(ahRequest.ServiceUsername, ahRequest.ServicePassword);
                    argtype sfgRequest = HeartbeatTranslators.TranslateToSfgRequest(ahRequest);
                    switch (methodCalled)
                    {
                        case Methods.PING:
                            baseResponse = HeartbeatTranslators.Ping(svc.process_wsdl(sfgRequest));
                            break;
                    }
                }
                if (baseResponse == null)
                {
                    baseResponse = new BaseResponse();
                    FatalErrorResponse fatalError = new FatalErrorResponse();
                    baseResponse.TypedResponse = fatalError;
                    baseResponse.Messages.Add(new Message("SFGFatalError"));
                }

            }
            catch (Exception ex)
            {
                baseResponse = new BaseResponse();
                FatalErrorResponse fatalError = new FatalErrorResponse();
                baseResponse.TypedResponse = fatalError;
                Message error = new Message("UnknownException");
                baseResponse.DebugStringLog.Add(ex.TargetSite.Name);
                baseResponse.DebugStringLog.Add(ex.Message);
                baseResponse.DebugStringLog.Add(ex.StackTrace);
                baseResponse.Messages.Add(error);
                EventLogger.LogError(string.Format("{0}.{1}()", new object[] { className, methodCalled.ToString() }),
                    string.Format("Message: {0} \r\nStackTrace: {1}", ex.Message, ex.StackTrace));
            }
            return baseResponse;
        }
Beispiel #5
0
        public static BaseResponse GetMemberByMemberId(GetMemberByMemberIdRequest ahRequest)
        {
            string className = "SFGWrapper.Gatekeeper.GetMemberByMemberId";
            BaseResponse baseResponse = new BaseResponse();
            try
            {
                using (GateKeeperService svc = new GateKeeperService())
                {
                    svc.Timeout = 20000;
                    System.Net.ServicePointManager.Expect100Continue = false;
                    svc.Credentials = new System.Net.NetworkCredential(ahRequest.ServiceUsername, ahRequest.ServicePassword);
                    argtype sfgRequest = GateKeeperTranslators.TranslateToGetMemberByMemberIdRequest(ahRequest);
                    baseResponse = GateKeeperTranslators.GetMemberByMemberId(svc.process_wsdl(sfgRequest));
                }
                if (baseResponse == null)
                {
                    baseResponse = new BaseResponse();
                    FatalErrorResponse fatalError = new FatalErrorResponse();
                    baseResponse.TypedResponse = fatalError;
                    baseResponse.Messages.Add(new Message("SFGFatalError"));
                }

            }
            catch (Exception ex)
            {
                baseResponse = new BaseResponse();
                FatalErrorResponse fatalError = new FatalErrorResponse();
                baseResponse.TypedResponse = fatalError;
                Message error = new Message("UnknownException");
                baseResponse.DebugStringLog.Add(ex.TargetSite.Name);
                baseResponse.DebugStringLog.Add(ex.Message);
                baseResponse.DebugStringLog.Add(ex.StackTrace);
                baseResponse.Messages.Add(error);
                EventLogger.LogError(className,
                    string.Format("Message: {0} \r\nStackTrace: {1}", ex.Message, ex.StackTrace));
            }
            return baseResponse;
        }
Beispiel #6
0
        public static BaseResponse GetMemberByMemberId(GetMemberByMemberIdRequest ahRequest)
        {
            string       className    = "SFGWrapper.Gatekeeper.GetMemberByMemberId";
            BaseResponse baseResponse = new BaseResponse();

            try
            {
                using (GateKeeperService svc = new GateKeeperService())
                {
                    svc.Timeout = 20000;
                    System.Net.ServicePointManager.Expect100Continue = false;
                    svc.Credentials = new System.Net.NetworkCredential(ahRequest.ServiceUsername, ahRequest.ServicePassword);
                    argtype sfgRequest = GateKeeperTranslators.TranslateToGetMemberByMemberIdRequest(ahRequest);
                    baseResponse = GateKeeperTranslators.GetMemberByMemberId(svc.process_wsdl(sfgRequest));
                }
                if (baseResponse == null)
                {
                    baseResponse = new BaseResponse();
                    FatalErrorResponse fatalError = new FatalErrorResponse();
                    baseResponse.TypedResponse = fatalError;
                    baseResponse.Messages.Add(new Message("SFGFatalError"));
                }
            }
            catch (Exception ex)
            {
                baseResponse = new BaseResponse();
                FatalErrorResponse fatalError = new FatalErrorResponse();
                baseResponse.TypedResponse = fatalError;
                Message error = new Message("UnknownException");
                baseResponse.DebugStringLog.Add(ex.TargetSite.Name);
                baseResponse.DebugStringLog.Add(ex.Message);
                baseResponse.DebugStringLog.Add(ex.StackTrace);
                baseResponse.Messages.Add(error);
                EventLogger.LogError(className,
                                     string.Format("Message: {0} \r\nStackTrace: {1}", ex.Message, ex.StackTrace));
            }
            return(baseResponse);
        }
        public static BaseResponse RedeemReferralSubscription(SubscriptionServiceRequest ahRequest)
        {
            string       className    = "SFGWrapper.CreateSubscription";
            BaseResponse baseResponse = new BaseResponse();

            try
            {
                using (SubOrderInsertService svc = new SubOrderInsertService())
                {
                    svc.Timeout     = 20000;
                    svc.Credentials = new System.Net.NetworkCredential(ahRequest.ServiceUsername, ahRequest.ServicePassword);
                    argtype sfgRequest = SubOrderInsertTranslators.TranslateToSfgRequest(ahRequest);
                    baseResponse = SubOrderInsertTranslators.CreateSubscription(svc.process_wsdl(sfgRequest));
                }
                if (baseResponse == null)
                {
                    baseResponse = new BaseResponse();
                    FatalErrorResponse fatalError = new FatalErrorResponse();
                    baseResponse.TypedResponse = fatalError;
                    baseResponse.Messages.Add(new Message("SFGFatalError"));
                }
            }
            catch (Exception ex)
            {
                baseResponse = new BaseResponse();
                FatalErrorResponse fatalError = new FatalErrorResponse();
                baseResponse.TypedResponse = fatalError;
                Message error = new Message("UnknownException");
                baseResponse.DebugStringLog.Add(ex.TargetSite.Name);
                baseResponse.DebugStringLog.Add(ex.Message);
                baseResponse.DebugStringLog.Add(ex.StackTrace);
                baseResponse.Messages.Add(error);
                EventLogger.LogError(string.Format("{0}()", new object[] { className }),
                                     string.Format("Message: {0} \r\nStackTrace: {1}", ex.Message, ex.StackTrace));
            }
            return(baseResponse);
        }
 public static BaseResponse GetResponse(CreditCardServiceRequest ahRequest)
 {
     string className = "SFGWrapper.CreditCardProcessing";
     BaseResponse baseResponse = new BaseResponse();
     try
     {
         using (CCProcessorService svc = new CCProcessorService())
         {
             svc.Timeout = 20000;
             svc.Credentials = new System.Net.NetworkCredential(ahRequest.ServiceUsername, ahRequest.ServicePassword);
             argtype sfgRequest = CreditCardTranslators.TranslateToSfgRequest(ahRequest);
             baseResponse = CreditCardTranslators.GetResponse(svc.process_wsdl(sfgRequest));
         }
         if (baseResponse == null)
         {
             baseResponse = new BaseResponse();
             FatalErrorResponse fatalError = new FatalErrorResponse();
             baseResponse.TypedResponse = fatalError;
             baseResponse.Messages.Add(new Message("SFGFatalError"));
         }
         
     }
     catch (Exception ex)
     {
         baseResponse = new BaseResponse();
         FatalErrorResponse fatalError = new FatalErrorResponse();
         baseResponse.TypedResponse = fatalError;
         Message error = new Message("UnknownException");
         baseResponse.DebugStringLog.Add(ex.TargetSite.Name);
         baseResponse.DebugStringLog.Add(ex.Message);
         baseResponse.DebugStringLog.Add(ex.StackTrace);
         baseResponse.Messages.Add(error);
         EventLogger.LogError(string.Format("{0}()", new object[] { className }),
             string.Format("Message: {0} \r\nStackTrace: {1}", ex.Message, ex.StackTrace));
     }
     return baseResponse;
 }