gpt4 book ai didi

php - 如何为 Ingram 微集成创建正确的订单测试?

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:40:52 24 4
gpt4 key购买 nike

我正在尝试为 ingram micro 创建一个订单测试,但我没有取得结果。

这是要发送的 xml 请求:

<OrderRequest>
<Version>2.0</Version>
<TransactionHeader>
<SenderID>123456789</SenderID>
<ReceiverID>987654321</ReceiverID>
<CountryCode>MD</CountryCode>
<LoginID>ingram_login</LoginID>
<Password>ingram_password</Password>
<TransactionID>54321</TransactionID>
</TransactionHeader>
<OrderHeaderInformation>
<BillToSuffix />
<AddressingInformation>
<CustomerPO>TEST PO ONLY - DO NOT SHIP</CustomerPO>
<ShipToAttention>Mrs Jones</ShipToAttention>
<EndUserPO>EndUserPO_1</EndUserPO>
<ShipTo>
<Address>
<ShipToAddress1>Red House Company</ShipToAddress1>
<ShipToAddress2>1730 105TH ST</ShipToAddress2>
<ShipToAddress3/>
<ShipToCity>NEW RICHMOND</ShipToCity>
<ShipToProvince>WI</ShipToProvince>
<ShipToPostalCode>54017</ShipToPostalCode>
</Address>
</ShipTo>
</AddressingInformation>
<ProcessingOptions>
<CarrierCode>F2</CarrierCode>
<AutoRelease>H</AutoRelease>
<ThirdPartyFreightAccount/>
<KillOrderAfterLineError>N</KillOrderAfterLineError>
<ShipmentOptions>
<BackOrderFlag>Y</BackOrderFlag>
<SplitShipmentFlag>N</SplitShipmentFlag>
<SplitLine>N</SplitLine>
<ShipFromBranches>10</ShipFromBranches>
<DeliveryDate>20090901</DeliveryDate>
</ShipmentOptions>
</ProcessingOptions>
<DynamicMessage>
<MessageLines>Deliver to Mrs Jones</MessageLines>
</DynamicMessage>
</OrderHeaderInformation>
<OrderLineInformation>
<ProductLine>
<SKU>TSXML3</SKU>
<Quantity>1</Quantity>
<CustomerLineNumber/>
<ReservedInventory>
<ReserveCode>C</ReserveCode>
<ReserveSequence>01</ReserveSequence>
</ReservedInventory>
<CustomerPartNumber/>
<UPC/>
<ManufacturerPartNumber/>
<ShipFromBranchAtLine>10</ShipFromBranchAtLine>
</ProductLine>
<CommentLine>
<CommentText>TEST PO ONLY - DO NOT SHIP</CommentText>
</CommentLine>
</OrderLineInformation>
<ShowDetail>1</ShowDetail>
</OrderRequest>

英格拉姆微回复:

<OrderResponse>
<Version>2.0</Version>
<TransactionHeader>
<SenderID>987654321</SenderID>
<ReceiverID>123456789</ReceiverID>
<ErrorStatus ErrorNumber="20196">
ERROR: One Productline can not have multiple parts in it when ShowDetail='2'
</ErrorStatus>
<DocumentID>{5535EC2F-DB51-4D35-B492-6425A0B9F62D}</DocumentID>
<TransactionID>54321</TransactionID>
<TimeStamp>2016-01-27T11:45:19</TimeStamp>
</TransactionHeader>
</OrderResponse>

我一直在尝试和研究响应 ErrorStatusProductline,但我还没有找到解决方案。提前致谢

抱歉,没有ingram-micro标签

最佳答案

只看IM-XML documentation我发现,<ProductLine> 有几个明显的问题你的例子的元素部分:

<ManufacturerPartNumber> Manufacturer Part Number - Do not specify if <SKU> or <UPC> are included

<UPC> EAN/UPC Number - Do not specify if <ManufacturerPartNumber> or <SKU> are included

<SKU> Ingram Micro product code Number - Do not specify if <ManufacturerPartNumber> or <UPC> are included

显然您应该只指定上述元素的值之一,您的示例指定了 SKU 的值和 UPC

<ReservedInventory> Contains reserved Inventory information. - Unless required, do not specify.

我对文档的快速浏览并不清楚何时需要这样做,但是您为此元素指定了一个值,并且我在示例中的其他任何地方都看不到任何明确的指示来说明为什么会这样在您的示例案例中需要。因此,让我们将此称为“可能”问题。

<ShipFromBranchAtLine>

我在文档中找不到对此元素的任何引用,因此它可能无效。我能找到的与该元素最接近的匹配项是 <ShipFromBranches> , 这不属于 <ProductLine>元素。

<CustomerPartNumber>

同样,我在文档中找不到对此的任何引用。

<RequestedPrice> Special Bid Price Parent : <SpecialBid>

你有 <RequestedPrice>作为 ProductLine 的直系子代, 当它应该在 <SpecialBid> 的内部时元素。

因此,考虑到以上所有因素,我注释掉了看起来错误的部分(或者可能是错误的,对于我们来说),如下所示:

    <ProductLine>
<SKU>NV9159</SKU>
<Quantity>1</Quantity>
<CustomerLineNumber/>
<!-- ResvervedInventory : Unless required, do not specify
<ReservedInventory>
<ReserveCode>C</ReserveCode>
<ReserveSequence>01</ReserveSequence>
</ReservedInventory>
-->
<!-- CustomerPartNumber element not defined in spec.
<CustomerPartNumber/>
-->
<!-- UPC : Do not specify if SKU included
<UPC>SP-RACKTRAY</UPC>
-->
<!-- ManufacturerPartNumber : Do not specify if SKU included
<ManufacturerPartNumber/>
-->
<!-- ShipFromBranchAtLine element not defined in spec.
<ShipFromBranchAtLine>10</ShipFromBranchAtLine>
-->
<!-- RequestedPrice : parent = SpecialBid
<RequestedPrice>163.36</RequestedPrice>
-->
</ProductLine>

如果我们只是将这些部分拉出来(假设它们都不应该在那里)并将它们设置为空元素,它可能看起来像:

    <ProductLine>
<SKU>NV9159</SKU>
<Quantity>1</Quantity>
<CustomerLineNumber/>
</ProductLine>

最后,直接引用您返回的错误:

One Productline can not have multiple parts in it when ShowDetail='2'

我假设这直接是由于您为 <SKU> 设置了一个值和 <UPC> ,这可能会使系统误以为您在(非法)指定这两个元素的值时试图包括“多个部件”(例如,两个不同的部件代码可能用于两个不同的实际部件)。

但即使情况并非如此,鉴于该错误的实际措辞,这似乎是最容易尝试做的事情,可能是尝试简单地更改 ShowDetail元素值来自:

<ShowDetail>2</ShowDetail>

<ShowDetail>1</ShowDetail>

我鼓励用 ProductLine 解决其他问题元素,但单独出现响应错误,您是否尝试更改 ShowDetail看看这是否有所作为?

关于php - 如何为 Ingram 微集成创建正确的订单测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35066941/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com