Пример #1
0
        public LTLRateShipmentResponse CalculateLTLRate(LTLRateShipmentRequest request)
        {
            //
            LTLRateShipmentResponse response = null;

            try {
                response = new RateWareGateway().CalculateLTLRate(request);
            }
            catch (Exception ex) { throw new FaultException <RateQuoteFault>(new RateQuoteFault(ex.Message), "Service Error"); }
            return(response);
        }
Пример #2
0
        public static LTLRateShipmentResponse CalculateLTLRate(LTLRateShipmentRequest request)
        {
            //
            LTLRateShipmentResponse response = null;
            RateQuoteServiceClient  client   = new RateQuoteServiceClient();

            try {
                response = client.CalculateLTLRate(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);
        }
Пример #3
0
        public LTLRateShipmentResponse CalculateLTLRate(LTLRateShipmentRequest request)
        {
            //
            LTLRateShipmentResponse  response = null;
            RateWareXLPortTypeClient client   = new RateWareXLPortTypeClient();

            try {
                AuthenticationToken authToken = getAuthenticationToken();
                if (client.isReady(authToken))
                {
                    //LTL rate shipment request
                    response = client.LTLRateShipment(authToken, request);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(response);
        }