Exception in DotNetShipping .Net 4.6
rsuliteanu opened this issue · 4 comments
Hi. I was hoping I could get a bit of help. I can't install ShippingRates since my OLD program is targeting .NET 4.6. The DotNetShipping code to retrieve UPS rates is working fine (and has been for a long time) on my production system (Azure), but on my development machine, I'm getting an exception:
System.Net.WebException: 'The operation has timed out'
Any ideas would be much appreciated!
Ron
Sorry, to be clear, the exception occurs on the GetRates call:
// Setup package and destination/origin addresses
var packages = new List<Package>();
// Package(length, width, height, weight, insured value)
packages.Add(new Package(8, 8, 6, weight, 100));
string shipToCountry = GetCountry(shipZip.Replace(" ", string.Empty));
var origin = new Address("", "", originZip, "US");
var destination = new Address("", "", shipZip, shipToCountry);
// Create RateManager
var rateManager = new RateManager();
rateManager.AddProvider(new UPSProvider(upsLicenseNumber, upsUserId, upsPassword));
// Call GetRates()
var shipment = rateManager.GetRates(origin, destination, packages);
Does it work if you open the production or development URL in your browser on the development machine?
https://wwwcie.ups.com/ups.app/xml/Rate for dev
https://onlinetools.ups.com/ups.app/xml/Rate for production
When you say, "Does it work...". I entered those URL's into Firefox on my dev system and got back a response for each (see attached file). My code is just calling the library's GetRates(origin, dest, packages) method. Nothing has changed there, but it has been a long time since I've worked on this app and for whatever reason I'm seeing the timeout. I plan to publish the code to my Azure staging server and confirm things are still working in that environment, but I'd love to be able to debug locally...
Thanks for the help! I really appreciate it.
UPS URL Responses.txt