Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in DotNetShipping .Net 4.6 #50

Closed
rsuliteanu opened this issue Jan 2, 2023 · 4 comments
Closed

Exception in DotNetShipping .Net 4.6 #50

rsuliteanu opened this issue Jan 2, 2023 · 4 comments

Comments

@rsuliteanu
Copy link

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

@rsuliteanu
Copy link
Author

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);

@alexeybusygin
Copy link
Owner

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

@rsuliteanu
Copy link
Author

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

@alexeybusygin
Copy link
Owner

We are still maintaining compatibility with .NET 4.6.1. Could you please try it with the latest version of ShippingRates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants