我試圖實施fedex API來計算一個國家的郵政編碼之間的運輸成本。它在美國工作正常。它也正在從美國到其他國家(嘗試IN和AU)。但是,當我嘗試從印度或澳大利亞的兩個郵政編碼作爲託運人和收件人地址。它給出以下錯誤: -聯邦快遞送貨API是在印度國內工作
The transaction returned an Error.
Severity: ERROR
Source: crs
Code: 691
Message: The PurposeOfShipmentType is null, empty or invalid.
LocalizedMessage: The PurposeOfShipmentType is null, empty or invalid.
不知道是什麼問題。我檢查了價值PurposeOfShipmentType在wsdl文件是露出下面的XML代碼: -
First occurrence
<xs:element name="Purpose" type="ns:PurposeOfShipmentType" minOccurs="0">
<xs:annotation>
<xs:documentation>The reason for the shipment. Note: SOLD is not a valid purpose for a Proforma Invoice.</xs:documentation>
</xs:annotation>
</xs:element>
second occurrence
<xs:simpleType name="PurposeOfShipmentType">
<xs:restriction base="xs:string">
<xs:enumeration value="GIFT"/>
<xs:enumeration value="NOT_SOLD"/>
<xs:enumeration value="PERSONAL_EFFECTS"/>
<xs:enumeration value="REPAIR_AND_RETURN"/>
<xs:enumeration value="SAMPLE"/>
<xs:enumeration value="SOLD"/>
</xs:restriction>
</xs:simpleType>
不要理解應該是什麼價值。下面是數組,我發送到$客戶 - > getRates($請求)功能
$request = Array
(
[WebAuthenticationDetail] => Array
(
[UserCredential] => Array
(
[Key] => *******
[Password] => *******
)
)
[ClientDetail] => Array
(
[AccountNumber] => *****
[MeterNumber] => *****
)
[TransactionDetail] => Array
(
[CustomerTransactionId] => *** Rate Available Services Request using PHP ***
)
[Version] => Array
(
[ServiceId] => crs
[Major] => 16
[Intermediate] => 0
[Minor] => 0
)
[ReturnTransitAndCommit] => 1
[RequestedShipment] => Array
(
[DropoffType] => REGULAR_PICKUP
[ShipTimestamp] => 2014-10-03T11:37:53+02:00
[Shipper] => Array
(
[Address] => Array
(
[StreetLines] => Array
(
[0] => 10 Fed Ex Pkwy
)
[City] => Memphis
[StateOrProvinceCode] =>
[PostalCode] => 110016
[CountryCode] => IN
)
)
[Recipient] => Array
(
[Address] => Array
(
[StreetLines] => Array
(
[0] => 13450 Farmcrest Ct
)
[City] => Herndon
[StateOrProvinceCode] =>
[PostalCode] => 302015
[CountryCode] => IN
)
)
[ShippingChargesPayment] => Array
(
[PaymentType] => SENDER
[Payor] => Array
(
[ResponsibleParty] => Array
(
[AccountNumber] => 510087500
[Contact] =>
[Address] => Array
(
[CountryCode] => IN
)
)
)
)
[PackageCount] => 2
[RequestedPackageLineItems] => Array
(
[0] => Array
(
[SequenceNumber] => 1
[GroupPackageCount] => 1
[Weight] => Array
(
[Value] => 2
[Units] => LB
)
[Dimensions] => Array
(
[Length] => 10
[Width] => 10
[Height] => 3
[Units] => IN
)
)
[1] => Array
(
[SequenceNumber] => 2
[GroupPackageCount] => 1
[Weight] => Array
(
[Value] => 5
[Units] => LB
)
[Dimensions] => Array
(
[Length] => 20
[Width] => 20
[Height] => 10
[Units] => IN
)
)
)
)
)
它會告訴你什麼是錯的。 'PurposeOfShipmentType'和'PurposeOfShipmentType'都是;空,空或無效。 – 2014-10-03 09:17:12
我已編輯您的評論問題。我檢查了PurposeOfShipmentType的值,但不知道它應該是什麼。 – 2014-10-03 09:24:46
你在寄什麼? – 2014-10-03 09:27:24