コード例 #1
0
        /// <summary>
        // Activate the remote interface IPaymentItemInterface
        /// </summary>
        /// <returns>true if activated else false</returns>
        public override bool ActivateTheInterface()
        {
            bool activated = false;

            try
            {
                WellKnownServiceTypeEntry WKSTE = new WellKnownServiceTypeEntry(typeof(IPaymentItemInterface), StateServerConfig.PaymentItemsServicesUrl, WellKnownObjectMode.SingleCall);
                if (RemotingConfiguration.ApplicationName == null)
                {
                    RemotingConfiguration.ApplicationName = "RestService";
                    RemotingConfiguration.RegisterWellKnownServiceType(WKSTE);
                }

                mPaymentItemProcess = (IPaymentItemInterface)Activator.GetObject(typeof(IPaymentItemInterface), WKSTE.ObjectUri);

                if (mPaymentItemProcess != null)
                {
                    activated = true;
                }
            }

            catch (Exception ex)
            {
                mLogger.Error("Error ActivateTheInterface ", ex);
            }

            return(activated);
        }
コード例 #2
0
        public string ProcessMessage(string paymentItemCommand, IPaymentItemInterface paymentItem)
        {
            string response = "";

            try
            {
                response = paymentItem.ProcessMessage(paymentItemCommand);
            }

            catch (Exception ex)
            {
                mErrorLogger.Error("PaymentItemsRequest paymentItemCommand", ex);
            }

            return(response);
        }