duanpiao6679 2014-02-24 12:22
浏览 183
已采纳

怎么样? 使用PHP API提交Amazon Create Fulfillment Order XML

I am struggling with the Amazon API at this point! I am trying to Create Fulfillment Orders, send orders to Amazon for them to fulfill.

I first need to create the XML which I have used the documentation @ http://www.jyi.org/wp-content/uploads/Amazon-xml.pdf Page 42 (labelled 38). This bit is fine, the XML is great..

I then need to submit this to Amazon, as always I would go down the route of using there API, the PHP Fulfilment Api is available here... https://developer.amazonservices.com/doc/fba/outbound/v20101001/php.html

In the 'Samples' folder Amazon have created a 'CreateFulfillmentOrderSample.php' which sounds exactly what I would like to do.

Now when I look at this file I can see what is going on however I cannot see where it wants the XML file to send to Amazon.

Any pointers or alternative methods would be greatly appreciated!!

  • 写回答

1条回答 默认 最新

  • douan9541 2014-02-26 01:39
    关注

    The samples provided with that code are not what it says on the tin. They are not samples, they are scaffolds to play with - meaning: without changes they don't do a thing. In your case, look at lines 70+ in Samples/CreateFulfillmentOrderSample.php:

    // @TODO: set request. Action can be passed as FBAOutboundServiceMWS_Model_CreateFulfillmentOrderRequest
    $request = new FBAOutboundServiceMWS_Model_CreateFulfillmentOrderRequest();
    // $request->setSellerId(SELLER_ID);
    
    // invokeCreateFulfillmentOrder($service, $request);
    

    If you run it, you should get an error message "Unable to construct from provided data. Please be sure to pass associative array or DOMElement".

    In your case, the XML should be passed as a DOMElement class parameter, so change above code to pass that parameter:

     $request = new FBAOutboundServiceMWS_Model_CreateFulfillmentOrderRequest($DOMElement);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题