Exemple #1
0
        //Interface
        static FinanceGateway()
        {
            //
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            _state   = true;
            _address = client.Endpoint.Address.Uri.AbsoluteUri;
        }
Exemple #2
0
        public static void WriteLogEntry(TraceMessage m)
        {
            //Write an entry into the Argix log
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                //client.WriteLogEntry(m);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
        }
Exemple #3
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the application configuration for the specified user
            UserConfiguration      config = null;
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                config = new UserConfiguration();   // client.GetUserConfiguration(application, usernames);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(config);
        }
Exemple #4
0
        public static DataModule[] GetAvailableTariffs()
        {
            //
            DataModule[]           tariffs = null;
            RateQuoteServiceClient client  = new RateQuoteServiceClient();

            try {
                tariffs = client.GetAvailableTariffs();
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(tariffs);
        }
Exemple #5
0
        public static ServiceInfo GetServiceInfo()
        {
            //Get the operating enterprise terminal
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                ServiceInfo info = new ServiceInfo();
                info.TerminalID  = 0;
                info.Description = "";
                return(info);   // client.GetServiceInfo();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
        }
Exemple #6
0
        //Just messing around
        public static DataSet ViewDeliveryZips()
        {
            //
            DataSet zips = new DataSet();
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                zips.Merge(client.ViewDeliveryZips());
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(zips);
        }
Exemple #7
0
        public static Decimal GetMileage(string originPostalCode, string destinationPostalCode)
        {
            //
            Decimal miles = 0;
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                miles = (Decimal)client.GetMileage(originPostalCode, destinationPostalCode);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(miles);
        }
Exemple #8
0
        public static LTLPointListResponse GetLTLPointList(LTLPointListRequest request)
        {
            //
            LTLPointListResponse   response = null;
            RateQuoteServiceClient client   = new RateQuoteServiceClient();

            try {
                response = client.GetLTLPointList(request);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(response);
        }
Exemple #9
0
        public static LTLRateShipmentResponse[] CalculateLTLRates(LTLRateShipmentRequest[] requests)
        {
            //
            LTLRateShipmentResponse[] response = null;
            RateQuoteServiceClient    client   = new RateQuoteServiceClient();

            try {
                response = client.CalculateLTLRates(requests);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(response);
        }
Exemple #10
0
        public static Rates CalculateRates(RateQuoteRequest request)
        {
            //
            Rates rates = null;
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                rates = client.CalculateRates(request.Tariff, request.OriginPostalCode, request.ClassCode, request.MCDiscount, request.UserMinimumChargeFloor, request.DestinationPostalCodes);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(rates);
        }
Exemple #11
0
        public static RateQuoteDataset GetClassCodes()
        {
            //
            RateQuoteDataset       classes = new RateQuoteDataset();
            RateQuoteServiceClient client  = new RateQuoteServiceClient();

            try {
                classes.Merge(client.GetClassCodes());
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(classes);
        }