1
Vote

After calling GetRates for UPS/USPS/FedEx, not able to get error message if weight is more than 150 or invalid zip code

description

After calling GetRates for UPS/USPS/FedEx, not able to get error message if weight is more than 150 or invalid zip code.

We are not able to get error when totalweight is more than 150lbs or zipcode is invalid. But still getting shipment.Rates as empty. shipment.ServerErrors are empty as well.

What are properties to get error using this the following code snippets?

Code Snippet:
                DotNetShipping.RateManager rate = new RateManager();
                DotNetShipping.ShippingProviders.UPSProvider upsprovider = new DotNetShipping.ShippingProviders.UPSProvider(const_Accesslicensenumber, const_UPS_UserID, const_UPS_Password, 2000);
                //upsprovider.UseProduction = false;
                rate.AddProvider(upsprovider);
                DotNetShipping.Address srcaddr = new Address(master.KEY4.ToString().Trim(), master.KEY6.ToString().Trim(), master.KEY7.ToString().Trim(), master.KEY5.ToString().Trim());
                DotNetShipping.Address dstaddr = new Address("", "", zipcode, countrycode);
                DotNetShipping.Package package = new Package(0, 0, 0, Convert.ToDecimal(totalweight), 0);
                DotNetShipping.Shipment shipment = rate.GetRates(srcaddr, dstaddr, package);
                rates = shipment.Rates;

comments