The error reported in the error log is:
I've traced the problem to how the API response is parsed from UPS. Normally UPS only returns one entry for each serviceCode (ship method) in the response. Suddenly now they're turning the 3-Day Select ship method (serviceCode=12) twice.Exception: An item with the same key has already been added.Stack Trace: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at CommerceBuilder.Shipping.Providers.UPS.UPS.ParseProviderRateReponse(XmlDocument providerResponse, Package[] packages) at CommerceBuilder.Shipping.Providers.UPS.UPS.GetAllProviderShipRateQuotes(Warehouse origin, Address destination, IList`1 contents) at CommerceBuilder.Shipping.Providers.UPS.UPS.GetShipRateQuote(Warehouse origin, Address destination, IList`1 contents, String serviceCode) at CommerceBuilder.Shipping.Providers.ShippingProviderBase.GetShipRateQuote(IShipment shipment, String serviceCode) at CommerceBuilder.Shipping.ShipMethod.GetShipRateQuote(IShipment shipment)
The Able code is built assuming every service code is unique. And for a very long time that has worked fine. There's no way to know how long before UPS reviews and resolves this issue. In the mean time, the fix is fairly simple if you have full source code access to the Able UPS provider:
Open the UPS.cs class file in the UPS project of the full source code.
Locate the ParseProviderRateResponse() method.
Within that method, find the code listed below and replace it with the suggested replacement.
Recompile the CommerceBuilder.UPS.Dll file in Visual Studio and deploy the updated DLL file to your live website /bin/ folder.
Restart your IIS application pool.
Here's the code to look for...
Code: Select all
availableServices.Add(serviceQuote.ServiceCode, serviceQuote);
Code: Select all
if (!availableServices.ContainsKey(serviceQuote.ServiceCode))
{
availableServices.Add(serviceQuote.ServiceCode, serviceQuote);
}