【发布时间】:2016-10-21 03:10:55
【问题描述】:
是否有人对 FedEx API 足够熟悉以使干冰发挥作用?
FedEx 干冰文档在这里:https://www.fedex.com/us/developer/WebHelp/ws/2014/dvg/WS_DVG_WebHelp/index.htm#25_2_Dry_Ice_Coding_Details.htm
然而,这似乎与他们的 WSDL 并不匹配。无论我尝试过什么,我总是会收到架构验证错误。
是否有人能够提供样品请求,包括干冰并获得成功响应?
我找不到有关放置 RequestedPackages 元素的正确位置的任何信息。我把它和 RequestedShipment 以及其他几个地方放在同一级别,但一无所获。
如果我只放置 RequestedShipment 字段而不是我得到的包裹信息:
8616 (Dry Ice cannot be entered at the shipment level.)
样品申请
这个示例请求是我得到的最接近的请求。不过 FedEx 不喜欢 RequestedPackages 元素的位置。我已经去掉了很多不必要的字段,比如下面的地址信息:
<ns:ProcessShipmentRequest xmlns:ns="http://fedex.com/ws/ship/v15" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://fedex.com/ws/ship/v15 ShipService v15.xsd">
<ns:WebAuthenticationDetail>
<ns:UserCredential>
</ns:UserCredential>
</ns:WebAuthenticationDetail>
<ns:ClientDetail>
</ns:ClientDetail>
<ns:TransactionDetail>
<ns:CustomerTransactionId>CreatePendingRequest</ns:CustomerTransactionId>
</ns:TransactionDetail>
<ns:Version>
<ns:ServiceId>ship</ns:ServiceId>
<ns:Major>15</ns:Major>
<ns:Intermediate>0</ns:Intermediate>
<ns:Minor>0</ns:Minor>
</ns:Version>
<ns:RequestedShipment>
<ns:ShipTimestamp>2016-10-21T10:17:09-07:00</ns:ShipTimestamp>
<ns:DropoffType>REGULAR_PICKUP</ns:DropoffType>
<ns:ServiceType>PRIORITY_OVERNIGHT</ns:ServiceType>
<ns:PackagingType>YOUR_PACKAGING</ns:PackagingType>
<ns:SpecialServicesRequested>
<ns:SpecialServiceTypes>DRY_ICE</ns:SpecialServiceTypes>
<ns:ShipmentDryIceDetail>
<ns:PackageCount>1</ns:PackageCount>
<ns:TotalWeight>
<ns:Units>KG</ns:Units>
<ns:Value>2.5</ns:Value>
</ns:TotalWeight>
</ns:ShipmentDryIceDetail>
</ns:SpecialServicesRequested>
<ns:LabelSpecification>
<ns:LabelFormatType>COMMON2D</ns:LabelFormatType>
<ns:ImageType>ZPLII</ns:ImageType>
<ns:LabelStockType>STOCK_4X6</ns:LabelStockType>
<ns:LabelPrintingOrientation>TOP_EDGE_OF_TEXT_FIRST</ns:LabelPrintingOrientation>
</ns:LabelSpecification>
<ns:RateRequestTypes>LIST</ns:RateRequestTypes>
<ns:PackageCount>1</ns:PackageCount>
<ns:RequestedPackageLineItems>
<ns:SequenceNumber>1</ns:SequenceNumber>
<ns:Weight>
<ns:Units>LB</ns:Units>
<ns:Value>8</ns:Value>
</ns:Weight>
<ns:Dimensions>
</ns:Dimensions>
<ns:SpecialServicesRequested>
<ns:SpecialServiceTypes>SIGNATURE_OPTION</ns:SpecialServiceTypes>
<ns:SignatureOptionDetail>
<ns:OptionType>SERVICE_DEFAULT</ns:OptionType>
</ns:SignatureOptionDetail>
</ns:SpecialServicesRequested>
</ns:RequestedPackageLineItems>
</ns:RequestedShipment>
<ns:RequestedPackages>
<ns:SpecialServicesRequested>
<ns:SpecialServiceTypes>DRY_ICE</ns:SpecialServiceTypes>
<ns:DryIceWeight>
<ns:Units>KG</ns:Units>
<ns:Value>2.5</ns:Value>
</ns:DryIceWeight>
</ns:SpecialServicesRequested>
</ns:RequestedPackages>
</ns:ProcessShipmentRequest>
联邦快递回应:
Element not allowed: RequestedPackages@http://fedex.com/ws/ship/v15 in element ProcessShipmentRequest@http://fedex.com/ws/ship/v15
我也尝试将包装级别的干冰信息放在RequestedPackageLineItems/SpecialServicesRequested 部分,但得到以下回复:
Expected elements \'PieceCountVerificationBoxCount@http://fedex.com/ws/ship/v15 PriorityAlertDetail@http://fedex.com/ws/ship/v15 AlcoholDetail@http://fedex.com/ws/ship/v15\' instead of \'DryIceWeight@http://fedex.com/ws/ship/v15\' here in element SpecialServicesRequested@http://fedex.com/ws/ship/v15
【问题讨论】:
-
如果你能分享你的代码,或者至少是重要的部分,那会有所帮助
-
我也面临同样的问题。请任何有与 FedEx 和 Dry 合作经验的人都应该在这里发帖。谢谢
-
这是我从文档开始的代码
标签: fedex