public Decimal GetMileage(string originPostalCode, string destinationPostalCode) { // Decimal miles = 0; RateWareXLPortTypeClient client = new RateWareXLPortTypeClient(); try { AuthenticationToken authToken = getAuthenticationToken(); if (client.isReady(authToken)) { ShipmentLocale org = new ShipmentLocale(); org.postalCode = originPostalCode; org.countryCode = "USA"; ShipmentLocale dest = new ShipmentLocale(); dest.postalCode = destinationPostalCode; dest.countryCode = "USA"; Mileage mileage = new Mileage(); mileage.releaseVersion = "22"; mileage.routingType = "P"; mileage.systemId = 1; mileage.origin = org; mileage.destination = dest; miles = (Decimal)client.Mileage(authToken, mileage); } 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(miles); }
public ClassesAndWeightsResponse GetClassesAndWeights(DataModule dataModule) { // ClassesAndWeightsResponse classes = null; RateWareXLPortTypeClient client = new RateWareXLPortTypeClient(); try { AuthenticationToken authToken = getAuthenticationToken(); if (client.isReady(authToken)) { classes = client.DataModuleValidClassesAndWeights(authToken, dataModule); } 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(classes); }
public LinearRateShipmentResponse[] CalculateLinearRates(LinearRateShipmentRequest[] requests) { // LinearRateShipmentResponse[] response = null; RateWareXLPortTypeClient client = new RateWareXLPortTypeClient(); try { AuthenticationToken authToken = getAuthenticationToken(); if (client.isReady(authToken)) { response = client.LinearRateShipmentMultiple(authToken, requests); } 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); }
public DataModule[] GetAvailableTariffs() { // DataModule[] tariffs = null; RateWareXLPortTypeClient client = new RateWareXLPortTypeClient(); try { AuthenticationToken authToken = getAuthenticationToken(); if (client.isReady(authToken)) { tariffs = client.AvailableTariffs(authToken); } 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(tariffs); }
public DensityRateShipmentResponse CalculateDensityRates(DensityRateShipmentRequest request) { // DensityRateShipmentResponse response = null; RateWareXLPortTypeClient client = new RateWareXLPortTypeClient(); try { AuthenticationToken authToken = getAuthenticationToken(); if (client.isReady(authToken)) { response = client.DensityRateShipment(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); }
public LTLPointListResponse GetLTLPointList(LTLPointListRequest request) { // LTLPointListResponse response = null; RateWareXLPortTypeClient client = new RateWareXLPortTypeClient(); try { AuthenticationToken authToken = getAuthenticationToken(); if (client.isReady(authToken)) { response = client.LTLPointList(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); }