UPS shipping rate query failure

1 week ago
Hi I am having some issue in getting ups rates using your plugin.
all details given correctly. please find the trace below and error message

Trace :
UPS rates. Request: <?xml version="1.0" encoding="utf-16"?>
<RateRequest1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <UPSSecurity>
    <UsernameToken xmlns="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0">
      <Username>xxxxxxx</Username>
      <Password>xxxxxxxxxx</Password>
    </UsernameToken>
    <ServiceAccessToken xmlns="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0">
      <AccessLicenseNumber>xxxxxxxxxxxx</AccessLicenseNumber>
    </ServiceAccessToken>
  </UPSSecurity>
  <RateRequest>
    <Request xmlns="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0">
      <RequestOption>Shop</RequestOption>
    </Request>
    <Shipment xmlns="http://www.ups.com/XMLSchema/XOLTWS/Rate/v1.1">
      <Shipper>
        <ShipperNumber>xxxxxx</ShipperNumber>
        <Address xsi:type="ShipAddressType">
          <AddressLine>24 Penrith Road</AddressLine>
          <City>Leicester</City>
          <StateProvinceCode />
          <PostalCode>LE4 6NX</PostalCode>
          <CountryCode>GB</CountryCode>
        </Address>
      </Shipper>
      <ShipTo>
        <Address>
          <City>east </City>
          <StateProvinceCode />
          <CountryCode>GB</CountryCode>
          <ResidentialAddressIndicator />
        </Address>
      </ShipTo>
      <ShipFrom>
        <Address>
          <AddressLine>24 Penrith Road</AddressLine>
          <City>Leicester</City>
          <StateProvinceCode />
          <PostalCode>LE4 6NX</PostalCode>
          <CountryCode>GB</CountryCode>
        </Address>
      </ShipFrom>
      <Package>
        <PackagingType>
          <Code>21</Code>
        </PackagingType>
        <Dimensions>
          <UnitOfMeasurement>
            <Code>IN</Code>
          </UnitOfMeasurement>
          <Length>64.00</Length>
          <Width>1.00</Width>
          <Height>1.00</Height>
        </Dimensions>
        <PackageWeight>
          <UnitOfMeasurement>
            <Code>LBS</Code>
          </UnitOfMeasurement>
          <Weight>15.00</Weight>
        </PackageWeight>
      </Package>
    </Shipment>
  </RateRequest>
</RateRequest1>


Error:
System.Exception: An exception has been raised as a result of client data.
Hard error: The postal code is invalid for GB.
---> System.ServiceModel.FaultException`1[UPSRate.ErrorDetailType[]]: An exception has been raised as a result of client data. (Fault Detail is equal to UPSRate.ErrorDetailType[]).
   --- End of inner exception stack trace ---
   at Nop.Plugin.Shipping.UPS.Services.UPSService.GetRatesAsync(RateRequest request)
   at Nop.Plugin.Shipping.UPS.Services.UPSService.GetShippingOptionsAsync(GetShippingOptionRequest shippingOptionRequest, Boolean saturdayDelivery)
1 week ago
i tried again and noticed that <shipto> tag not fetching the <postalcode>. it could be plugin error.
any one have idea regarding this ?

UPS rates. Request: <?xml version="1.0" encoding="utf-16"?>
<RateRequest1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <UPSSecurity>
    <UsernameToken xmlns="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0">
      <Username>xxxxxxxxxxx</Username>
      <Password>xxxxxxxxxx</Password>
    </UsernameToken>
    <ServiceAccessToken xmlns="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0">
      <AccessLicenseNumber>xxxxxxxxxxxxxxx</AccessLicenseNumber>
    </ServiceAccessToken>
  </UPSSecurity>
  <RateRequest>
    <Request xmlns="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0">
      <RequestOption>Shop</RequestOption>
    </Request>
    <Shipment xmlns="http://www.ups.com/XMLSchema/XOLTWS/Rate/v1.1">
      <Shipper>
        <ShipperNumber>xxxxxxxxxx</ShipperNumber>
        <Address xsi:type="ShipAddressType">
          <AddressLine>24 Penrith Road</AddressLine>
          <City>Leicester</City>
          <StateProvinceCode />
          <PostalCode>LE4 6NX</PostalCode>
          <CountryCode>GB</CountryCode>
        </Address>
      </Shipper>
      <ShipTo>
        <Address>
          <City>london</City>
          <StateProvinceCode />
          <CountryCode>GB</CountryCode>
          <ResidentialAddressIndicator />
        </Address>
      </ShipTo>
      <ShipFrom>
        <Address>
          <AddressLine>24 Penrith Road</AddressLine>
          <City>Leicester</City>
          <StateProvinceCode />
          <PostalCode>LE4 6NX</PostalCode>
          <CountryCode>GB</CountryCode>
        </Address>
      </ShipFrom>
      <Package>
        <PackagingType>
          <Code>21</Code>
        </PackagingType>
        <Dimensions>
          <UnitOfMeasurement>
            <Code>IN</Code>
          </UnitOfMeasurement>
          <Length>64.00</Length>
          <Width>1.00</Width>
          <Height>1.00</Height>
        </Dimensions>
        <PackageWeight>
          <UnitOfMeasurement>
            <Code>LBS</Code>
          </UnitOfMeasurement>
          <Weight>15.00</Weight>
        </PackageWeight>
      </Package>
    </Shipment>
  </RateRequest>
</RateRequest1>
1 week ago
What plugin, what version?
1 week ago
And, are you using any 3rd party "one page checkout"?
1 week ago
Hi Maksim

it is ups shipping module Version: 1.70 and storefront version is 4.5. please find the error below

System.Exception: An exception has been raised as a result of client data.
Hard error: The postal code is invalid for GB.
---> System.ServiceModel.FaultException`1[UPSRate.ErrorDetailType[]]: An exception has been raised as a result of client data. (Fault Detail is equal to UPSRate.ErrorDetailType[]).
   --- End of inner exception stack trace ---
   at Nop.Plugin.Shipping.UPS.Services.UPSService.GetRatesAsync(RateRequest request)
   at Nop.Plugin.Shipping.UPS.Services.UPSService.GetShippingOptionsAsync(GetShippingOptionRequest shippingOptionRequest, Boolean saturdayDelivery)
1 week ago
In general, the error "Hard error: The postal code is invalid for GB" means that the State Code used does not have the correct format or that the postal code / province does not match.

In your case, from your trace message above, I don't see that you have any  <PostalCode> element in the ShipTo:
<ShipTo>
<Address>
  <City>london</City>
  <StateProvinceCode />
  <CountryCode>GB</CountryCode>
  <ResidentialAddressIndicator />
</Address>
</ShipTo>
1 week ago
Hi
That what i am worrying as well. Why xml not fetched with postalcode. Could be some error. Because customer has all correct address info including postcode. It is either storefront ui or plugin not reading it correctly before build the xml.
1 week ago
Are you using a 3rd party one page checkout?
1 week ago
Hi

No i dont have onepage checkout installed or enabled.
1 week ago
I just checked that the plugin works fine on a clean installation, all shipping address fields are correctly filled in the request, and rates successfully return in a response.
Do you use any third-party themes or plugins (especially for checkout)?