Author: sichen Date: Thu Oct 12 10:52:33 2006 New Revision: 463344 URL: http://svn.apache.org/viewvc?view=rev&rev=463344 Log: Fixed rate shopping option for upsRateEstimate
Modified: incubator/ofbiz/trunk/applications/product/servicedef/services_shipment_ups.xml incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java Modified: incubator/ofbiz/trunk/applications/product/servicedef/services_shipment_ups.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/servicedef/services_shipment_ups.xml?view=diff&rev=463344&r1=463343&r2=463344 ============================================================================== --- incubator/ofbiz/trunk/applications/product/servicedef/services_shipment_ups.xml (original) +++ incubator/ofbiz/trunk/applications/product/servicedef/services_shipment_ups.xml Thu Oct 12 10:52:33 2006 @@ -25,7 +25,8 @@ <!-- UPS Rate API Services --> <service name="upsRateEstimate" engine="java" location="org.ofbiz.shipment.thirdparty.ups.UpsServices" invoke="upsRateInquire" auth="false"> - <description>UPS On-Line rate inquire tool</description> + <description>UPS On-Line rate inquire tool. Also supports rate shopping by setting upsRateInquireMode to 'Shop', and upsRateCodeMap + will return a Map of serviceCode -> rate</description> <implements service="calcShipmentEstimateInterface"/> <attribute name="upsRateInquireMode" type="String" mode="IN" optional="true"/> <attribute name="upsRateCodeMap" type="Map" mode="OUT" optional="false"/> Modified: incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java?view=diff&rev=463344&r1=463343&r2=463344 ============================================================================== --- incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java (original) +++ incubator/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java Thu Oct 12 10:52:33 2006 @@ -1365,6 +1365,7 @@ } if (upsRateInquireMode == null || !"Shop".equals(upsRateInquireMode)) { // can be either Rate || Shop + Debug.logWarning("No upsRateInquireMode set, defaulting to 'Rate'", module); upsRateInquireMode = "Rate"; } @@ -1442,8 +1443,8 @@ UtilXml.addChildElementValue(transactionReferenceElement, "CustomerContext", "Rating and Service", rateRequestDoc); UtilXml.addChildElementValue(transactionReferenceElement, "XpciVersion", "1.0001", rateRequestDoc); - // set to Rate or Shop mode - UtilXml.addChildElementValue(requestElement, "RequestAction", upsRateInquireMode, rateRequestDoc); + // RequestAction is always Rate, but RequestOption can be Rate to get a single rate or Shop for all shipping methods + UtilXml.addChildElementValue(requestElement, "RequestAction", "Rate", rateRequestDoc); UtilXml.addChildElementValue(requestElement, "RequestOption", upsRateInquireMode, rateRequestDoc); // set the pickup type