UPS API LTL Rate 给出缺失或无效的国家代码 (9360702)
UPS API LTL Rate giving Missing or invalid Country Code (9360702)
我正在 API 致电 UPS LTL FreightRate 以查看从美国到 EN(英国)的运输价格。
但是 SOAP 调用 returns 错误 9360702 说:
Missing or invalid Country Code(s) provided in request.
我实际上已经查看了 API PDF,国家代码是正确的 EN
。
知道为什么会这样吗?
这是我的实际要求:
(
[Request] = Array
(
[RequestOption] = 1
[SubVersion] = 1601
)
[Service] = Array
(
[Code] = 308
)
[ShipFrom] = Array
(
[Name] =
[Address] = Array
(
[AddressLine] = 11552 Kingsmill Place
[City] = Odessa
[StateProvinceCode] = FL
[PostalCode] =
[CountryCode] = US
)
)
[ShipTo] = Array
(
[Name] =
[Address] = Array
(
[AddressLine] =
[City] =
[StateProvinceCode] =
[PostalCode] = E1 4LJ
[CountryCode] = EN
)
)
[PaymentInformation] = Array
(
[Payer] = Array
(
[Name] = MY ADDRESS
[Address] = Array
(
[AddressLine] = 11552 500
[City] = Odessa
[StateProvinceCode] = FL
[PostalCode] = 33556
[CountryCode] = US
)
)
[ShipmentBillingOption] = Array
(
[Code] = 10
)
)
[HandlingUnitOne] = Array
(
[Quantity] = 1
[Type] = Array
(
[Code] = PLT
)
)
[Commodity] = Array
(
[CommodityID] =
[Description] = No Description
[Weight] = Array
(
[UnitOfMeasurement] = Array
(
[Code] = LBS
)
[Value] = 65
)
[NumberOfPieces] = 2
[PackagingType] = Array
(
[Code] = BOX
)
[Dimensions] = Array
(
[UnitOfMeasurement] = Array
(
[Code] = IN
)
[Length] = 11.02
[Width] = 14.17
[Height] = 5.91
)
[FreightClass] = 70
)
[ShipmentServiceOptions] = Array
(
[PickupOptions] = Array
(
[ResidentialPickupIndicator] =
[LiftGateRequiredIndicator] =
)
)
)
###更新###
使用以下信息重现此错误,XML 使用 SOAP UI。
请求URL:https://onlinetools.ups.com/webservices/FreightRate
请记得添加您自己的 Username
、Password
、License Number
和 Shipper Number
。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" xmlns:v11="http://www.ups.com/XMLSchema/XOLTWS/FreightRate/v1.0" xmlns:v12="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0">
<soapenv:Header>
<v1:UPSSecurity>
<v1:UsernameToken>
<v1:Username>YOUR USERNAME</v1:Username>
<v1:Password>YOUR PASSWORK</v1:Password>
</v1:UsernameToken>
<v1:ServiceAccessToken>
<v1:AccessLicenseNumber>YOUR LICENSE NUMBER</v1:AccessLicenseNumber>
</v1:ServiceAccessToken>
</v1:UPSSecurity>
</soapenv:Header>
<soapenv:Body>
<v11:FreightRateRequest>
<v12:Request>
<!--Zero or more repetitions:-->
<v12:RequestOption>1</v12:RequestOption>
<!--Optional:-->
<v12:SubVersion>1601</v12:SubVersion>
</v12:Request>
<v11:ShipFrom>
<v11:Name></v11:Name>
<v11:Address>
<!--1 to 3 repetitions:-->
<v11:AddressLine>11552 Kingsmill PLace</v11:AddressLine>
<v11:City>Odessa</v11:City>
<!--Optional:-->
<v11:StateProvinceCode>FL</v11:StateProvinceCode>
<!--Optional:-->
<v11:Town></v11:Town>
<!--Optional:-->
<v11:PostalCode>33556</v11:PostalCode>
<v11:CountryCode>US</v11:CountryCode>
</v11:Address>
</v11:ShipFrom>
<v11:ShipTo>
<v11:Name/>
<v11:Address>
<!--1 to 3 repetitions:-->
<v11:AddressLine>266 mile end road</v11:AddressLine>
<v11:City>London</v11:City>
<!--Optional:-->
<v11:StateProvinceCode></v11:StateProvinceCode>
<!--Optional:-->
<v11:Town/>
<!--Optional:-->
<v11:PostalCode>E1 4LJ</v11:PostalCode>
<v11:CountryCode>GB</v11:CountryCode>
</v11:Address>
</v11:ShipTo>
<v11:PaymentInformation>
<v11:Payer>
<v11:Name></v11:Name>
<v11:Address>
<!--1 to 3 repetitions:-->
<v11:AddressLine>11552 Kingsmill Place</v11:AddressLine>
<v11:City>Odessa</v11:City>
<!--Optional:-->
<v11:StateProvinceCode>FL</v11:StateProvinceCode>
<!--Optional:-->
<v11:PostalCode>33556</v11:PostalCode>
<v11:CountryCode>US</v11:CountryCode>
</v11:Address>
<!--Optional:-->
<v11:ShipperNumber>YOUR SHIPPER NUMBER</v11:ShipperNumber>
<!--Optional:-->
<v11:AttentionName/>
</v11:Payer>
<v11:ShipmentBillingOption>
<v11:Code>10</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:ShipmentBillingOption>
</v11:PaymentInformation>
<v11:Service>
<v11:Code>308</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:Service>
<v11:HandlingUnitOne>
<v11:Quantity>1</v11:Quantity>
<v11:Type>
<v11:Code>PLT</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:Type>
</v11:HandlingUnitOne>
<!--1 or more repetitions:-->
<v11:Commodity>
<!--Optional:-->
<v11:CommodityID/>
<v11:Description>No Description</v11:Description>
<v11:Weight>
<v11:Value>65</v11:Value>
<v11:UnitOfMeasurement>
<v11:Code>LBS</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:UnitOfMeasurement>
</v11:Weight>
<!--Optional:-->
<v11:Dimensions>
<v11:UnitOfMeasurement>
<v11:Code>IN</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:UnitOfMeasurement>
<v11:Length>11.02</v11:Length>
<v11:Width>14.17</v11:Width>
<v11:Height>5.91</v11:Height>
</v11:Dimensions>
<v11:NumberOfPieces>2</v11:NumberOfPieces>
<v11:PackagingType>
<v11:Code>BOX</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:PackagingType>
<!--Optional:-->
<v11:FreightClass>70</v11:FreightClass>
</v11:Commodity>
</v11:FreightRateRequest>
</soapenv:Body>
</soapenv:Envelope>
两次联系UPS,终于得到回复。
事实证明零担货运费率不适用于 GB/UK/EN。这就是国家代码错误的原因。
我正在 API 致电 UPS LTL FreightRate 以查看从美国到 EN(英国)的运输价格。
但是 SOAP 调用 returns 错误 9360702 说:
Missing or invalid Country Code(s) provided in request.
我实际上已经查看了 API PDF,国家代码是正确的 EN
。
知道为什么会这样吗?
这是我的实际要求:
(
[Request] = Array
(
[RequestOption] = 1
[SubVersion] = 1601
)
[Service] = Array
(
[Code] = 308
)
[ShipFrom] = Array
(
[Name] =
[Address] = Array
(
[AddressLine] = 11552 Kingsmill Place
[City] = Odessa
[StateProvinceCode] = FL
[PostalCode] =
[CountryCode] = US
)
)
[ShipTo] = Array
(
[Name] =
[Address] = Array
(
[AddressLine] =
[City] =
[StateProvinceCode] =
[PostalCode] = E1 4LJ
[CountryCode] = EN
)
)
[PaymentInformation] = Array
(
[Payer] = Array
(
[Name] = MY ADDRESS
[Address] = Array
(
[AddressLine] = 11552 500
[City] = Odessa
[StateProvinceCode] = FL
[PostalCode] = 33556
[CountryCode] = US
)
)
[ShipmentBillingOption] = Array
(
[Code] = 10
)
)
[HandlingUnitOne] = Array
(
[Quantity] = 1
[Type] = Array
(
[Code] = PLT
)
)
[Commodity] = Array
(
[CommodityID] =
[Description] = No Description
[Weight] = Array
(
[UnitOfMeasurement] = Array
(
[Code] = LBS
)
[Value] = 65
)
[NumberOfPieces] = 2
[PackagingType] = Array
(
[Code] = BOX
)
[Dimensions] = Array
(
[UnitOfMeasurement] = Array
(
[Code] = IN
)
[Length] = 11.02
[Width] = 14.17
[Height] = 5.91
)
[FreightClass] = 70
)
[ShipmentServiceOptions] = Array
(
[PickupOptions] = Array
(
[ResidentialPickupIndicator] =
[LiftGateRequiredIndicator] =
)
)
)
###更新###
使用以下信息重现此错误,XML 使用 SOAP UI。
请求URL:https://onlinetools.ups.com/webservices/FreightRate
请记得添加您自己的 Username
、Password
、License Number
和 Shipper Number
。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" xmlns:v11="http://www.ups.com/XMLSchema/XOLTWS/FreightRate/v1.0" xmlns:v12="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0">
<soapenv:Header>
<v1:UPSSecurity>
<v1:UsernameToken>
<v1:Username>YOUR USERNAME</v1:Username>
<v1:Password>YOUR PASSWORK</v1:Password>
</v1:UsernameToken>
<v1:ServiceAccessToken>
<v1:AccessLicenseNumber>YOUR LICENSE NUMBER</v1:AccessLicenseNumber>
</v1:ServiceAccessToken>
</v1:UPSSecurity>
</soapenv:Header>
<soapenv:Body>
<v11:FreightRateRequest>
<v12:Request>
<!--Zero or more repetitions:-->
<v12:RequestOption>1</v12:RequestOption>
<!--Optional:-->
<v12:SubVersion>1601</v12:SubVersion>
</v12:Request>
<v11:ShipFrom>
<v11:Name></v11:Name>
<v11:Address>
<!--1 to 3 repetitions:-->
<v11:AddressLine>11552 Kingsmill PLace</v11:AddressLine>
<v11:City>Odessa</v11:City>
<!--Optional:-->
<v11:StateProvinceCode>FL</v11:StateProvinceCode>
<!--Optional:-->
<v11:Town></v11:Town>
<!--Optional:-->
<v11:PostalCode>33556</v11:PostalCode>
<v11:CountryCode>US</v11:CountryCode>
</v11:Address>
</v11:ShipFrom>
<v11:ShipTo>
<v11:Name/>
<v11:Address>
<!--1 to 3 repetitions:-->
<v11:AddressLine>266 mile end road</v11:AddressLine>
<v11:City>London</v11:City>
<!--Optional:-->
<v11:StateProvinceCode></v11:StateProvinceCode>
<!--Optional:-->
<v11:Town/>
<!--Optional:-->
<v11:PostalCode>E1 4LJ</v11:PostalCode>
<v11:CountryCode>GB</v11:CountryCode>
</v11:Address>
</v11:ShipTo>
<v11:PaymentInformation>
<v11:Payer>
<v11:Name></v11:Name>
<v11:Address>
<!--1 to 3 repetitions:-->
<v11:AddressLine>11552 Kingsmill Place</v11:AddressLine>
<v11:City>Odessa</v11:City>
<!--Optional:-->
<v11:StateProvinceCode>FL</v11:StateProvinceCode>
<!--Optional:-->
<v11:PostalCode>33556</v11:PostalCode>
<v11:CountryCode>US</v11:CountryCode>
</v11:Address>
<!--Optional:-->
<v11:ShipperNumber>YOUR SHIPPER NUMBER</v11:ShipperNumber>
<!--Optional:-->
<v11:AttentionName/>
</v11:Payer>
<v11:ShipmentBillingOption>
<v11:Code>10</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:ShipmentBillingOption>
</v11:PaymentInformation>
<v11:Service>
<v11:Code>308</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:Service>
<v11:HandlingUnitOne>
<v11:Quantity>1</v11:Quantity>
<v11:Type>
<v11:Code>PLT</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:Type>
</v11:HandlingUnitOne>
<!--1 or more repetitions:-->
<v11:Commodity>
<!--Optional:-->
<v11:CommodityID/>
<v11:Description>No Description</v11:Description>
<v11:Weight>
<v11:Value>65</v11:Value>
<v11:UnitOfMeasurement>
<v11:Code>LBS</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:UnitOfMeasurement>
</v11:Weight>
<!--Optional:-->
<v11:Dimensions>
<v11:UnitOfMeasurement>
<v11:Code>IN</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:UnitOfMeasurement>
<v11:Length>11.02</v11:Length>
<v11:Width>14.17</v11:Width>
<v11:Height>5.91</v11:Height>
</v11:Dimensions>
<v11:NumberOfPieces>2</v11:NumberOfPieces>
<v11:PackagingType>
<v11:Code>BOX</v11:Code>
<!--Optional:-->
<v11:Description/>
</v11:PackagingType>
<!--Optional:-->
<v11:FreightClass>70</v11:FreightClass>
</v11:Commodity>
</v11:FreightRateRequest>
</soapenv:Body>
</soapenv:Envelope>
两次联系UPS,终于得到回复。
事实证明零担货运费率不适用于 GB/UK/EN。这就是国家代码错误的原因。