2012-08-10 42 views
2

我嘗試從fedex接收運費,因此我發送到Fedex(https://wsbeta.fedex.com:443/web-services/rate)請求,其格式如下(它被序列化爲XML對象):服務類型優先於運營商代碼;用於評估錯誤的服務類型

<?xml version=\"1.0\" encoding=\"utf-16\"?> 
<RateRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> 
    <WebAuthenticationDetail xmlns=\"http://fedex.com/ws/rate/v10\"> 
    <UserCredential> 
     <Key>some key</Key> 
     <Password>some password</Password> 
    </UserCredential> 
    </WebAuthenticationDetail> 
    <ClientDetail xmlns=\"http://fedex.com/ws/rate/v10\"> 
    <AccountNumber>some account number</AccountNumber> 
    <MeterNumber>some meter number</MeterNumber> 
    </ClientDetail> 
    <TransactionDetail xmlns=\"http://fedex.com/ws/rate/v10\"> 
    <CustomerTransactionId>some CustomerTransactionId</CustomerTransactionId> 
    </TransactionDetail> 
    <Version xmlns=\"http://fedex.com/ws/rate/v10\"> 
    <ServiceId>crs</ServiceId> 
    <Major>10</Major> 
    <Intermediate>0</Intermediate> 
    <Minor>0</Minor> 
    </Version> 
    <ReturnTransitAndCommit xmlns=\"http://fedex.com/ws/rate/v10\">true</ReturnTransitAndCommit> 
    <CarrierCodes xmlns=\"http://fedex.com/ws/rate/v10\">FDXE</CarrierCodes> 
    <RequestedShipment xmlns=\"http://fedex.com/ws/rate/v10\"> 
    <ShipTimestamp>2012-08-10T11:42:00.2669059+02:00</ShipTimestamp> 
    <ServiceType>GROUND_HOME_DELIVERY</ServiceType> 
    <PackagingType>YOUR_PACKAGING</PackagingType> 
    <TotalInsuredValue> 
     <Currency>USD</Currency> 
    </TotalInsuredValue> 
    <Shipper> 
     <Address> 
     <City>San Francisco</City> 
     <StateOrProvinceCode>CA</StateOrProvinceCode> 
     <PostalCode>94129</PostalCode> 
     <CountryCode>US</CountryCode> 
     </Address> 
    </Shipper> 
    <Recipient> 
     <Address> 
     <StreetLines>S</StreetLines> 
     <StreetLines>s</StreetLines> 
     <City>New York</City> 
     <StateOrProvinceCode>NY</StateOrProvinceCode> 
     <PostalCode>10001</PostalCode> 
     <CountryCode>US</CountryCode> 
     <Residential>true</Residential> 
     </Address> 
    </Recipient> 
    <ShippingChargesPayment /> 
    <RateRequestTypes>ACCOUNT</RateRequestTypes> 
    <RateRequestTypes>LIST</RateRequestTypes> 
    <PackageCount>1</PackageCount> 
    <RequestedPackageLineItems> 
     <SequenceNumber>1</SequenceNumber> 
     <GroupPackageCount>1</GroupPackageCount> 
     <InsuredValue /> 
     <Weight> 
     <Units>LB</Units> 
     <Value>133.00000</Value> 
     </Weight> 
     <Dimensions> 
     <Units>IN</Units> 
     </Dimensions> 
    </RequestedPackageLineItems> 
    </RequestedShipment> 
</RateRequest> 

我仍然收到兩個錯誤:

  • 870 - 服務類型的優先級高於載體碼;用於評分的服務類型
  • 809 - 包裝1 - 重量缺失或無效。

我應該改變什麼來解決這個問題?

回答

4

我找到了解決辦法。要解決第一個問題,我必須更改沒有套用CarrierCodes的ServiceType值。適用於GROUND_HOME_DELIVERY的CarrierCode是FDXG。

第二個問題是重量超過70磅的包應該使用FEDEX_GROUND而不是GROUND_HOME_DELIVERY發送​​。