开发者

Amazon MWS problem with _POST_INVENTORY_AVAILABILITY_DATA_

开发者 https://www.devze.com 2023-02-21 05:39 出处:网络
im using the \"C# Library for Batch Data Exchange Feeds\" from https://mws.amazon.com/doc/en_US/bde/feeds/v20090901/cSharp.html

im using the "C# Library for Batch Data Exchange Feeds" from https://mws.amazon.com/doc/en_US/bde/feeds/v20090901/cSharp.html

I want to update the quantity of a product, I get a repsonse with "SUBMITTED" and the function "GetFeedSubmissionResult" returns also "DONE". If I check the "Celler Central", nothing is happend. How can I see what went wrong updating the quantity?

MarketplaceWebServiceConfig mwsConfig2 = new MarketplaceWebServiceConfig();
mwsConfig2.ServiceURL = AmazonEndpointUrl;
mwsConfig2.SetUserAgentHeader("AMService", "1.01", "C#", new string[] { });

MarketplaceWebServiceClient mwsclient = new MarketplaceWebServiceClient(AmazonAccessKeyID, AmazonSecretAccessKey, mwsConfig2);
SubmitFeedRequest sfrequest = new SubmitFeedRequest();
sfrequest.Merchant = AmazonMerchantID;
sfrequest.Marketplace = AmazonMarketplaceID;

System.IO.MemoryStream stre = GetInventoryFeed("15084549", "2");
sfrequest.FeedContent = stre;
sfrequest.ContentMD5 = MarketplaceWebServiceClient.CalculateContentMD5(sfrequest.FeedContent);
sfrequest.FeedContent.Position = 0;
sfrequest.FeedType = "_POST_INVENTORY_AVAILABILITY_DATA_";
InvokeSubmitFeed(mwsclient, sfrequest);

REQUEST:

POST https://mws.amazonaws.de/?Action=SubmitFeed&Marketplace=...&Merchant=...&FeedType=_POST_INVENTORY_AVAILABILITY_DATA_&AWSAccessKeyId=...&Timestamp=2011-03-29T13%3A27%3A51.891Z&Version=2009-01-01&SignatureVersion=2&SignatureMethod=HmacSHA256&Signature=94hzhCLExKOFQqoMQgVuS1jfxaE8bOXnWJBgr%2FiTd7A%3D HTTP/1.1
User-Agent: myProjectcomAMService/1.01 (Language=C#)
Content-Type: application/octet-stream
Content-MD5: lHQpXA3bHBB5bXaPlu+5/g==
Host: mws.amazonaws.de
Connection: Keep-Alive
Content-Length: 534

<?xml version="1.0"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Header>
<DocumentVers开发者_Python百科ion>1.01</DocumentVersion>
<MerchantIdentifier>M_myProjectDOTC_11111</MerchantIdentifier>
</Header>
<MessageType>Inventory</MessageType>
<MarketplaceName>myProjectdotcom</MarketplaceName>
<Message>
<MessageID>1</MessageID>
<Inventory>
<SKU>15084549</SKU>
<Quantity>2</Quantity>
</Inventory>
</Message>
</AmazonEnvelope>

RESPONSE:

HTTP/1.1 200 OK
Date: Tue, 29 Mar 2011 13:27:52 GMT
Server: Server
Content-Type: text/xml
Vary: Accept-Encoding,User-Agent
Content-Length: 500

<?xml version="1.0"?>
<SubmitFeedResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
<SubmitFeedResult>
<FeedSubmissionInfo>
<FeedSubmissionId>...</FeedSubmissionId>
<FeedType>_POST_INVENTORY_AVAILABILITY_DATA_</FeedType>
<SubmittedDate>2011-03-29T13:27:52+00:00</SubmittedDate>
<FeedProcessingStatus>_SUBMITTED_</FeedProcessingStatus>
</FeedSubmissionInfo></SubmitFeedResult><ResponseMetadata>
<RequestId>65fbc17a-5f5b-4a27-b470-c8913715ef9f</RequestId>
</ResponseMetadata>
</SubmitFeedResponse>


You should check the status of your feed by its ID by using the operation getfeedsubmissionresult


    Thread.Sleep(240000);
                        errorMessage = string.Empty;
                        errorArticleIDList = new SortedList<string, string>();
                        if (GetSubmitFeedReport(feedSubmissionId, out errorMessage, out errorArticleIDList))
                        {
                            if (errorMessage != string.Empty)
                            {
                                _log.ErrorFormat("FEHLER UpdateAmazonArticleStock: {0}", errorMessage);
                            }

                            foreach (AmazonArticleInfo amzArticle in rcavAmzArticleList)
                            {
                                if (errorArticleIDList.Count > 0)
                                {
                                    if (!errorArticleIDList.ContainsKey(amzArticle.ArticleID.ToString()))
                                    {
                                        // Die Artikelbestände von den relevanten Artikel aktuallisieren, bzw deaktivierte Artikel wieder aktivieren
                                        // Bestand = 0 --> deaktiviert
                                    if (!amzArticle.StockToLow && !amzArticle.NotAmazonRelevant)
                                        {
                                            amzArticle.AmazonActive = true;
                                        }
                                        // Alle nicht mehr relevanten Artikel in amazon deaktivieren
                                        else
                                        {
                                            amzArticle.AmazonActive = false;
                                        }
                                        dlAmazon.UpdateAmazonArticleAVDB(amzArticle);
                                    }
                                }
                                else
                                {
                                    if (errorMessage == string.Empty)
                                    {
                                        dlAmazon.UpdateAmazonArticleAVDB(amzArticle);
                                    }
                                }
                            }
                        }
0

精彩评论

暂无评论...
验证码 换一张
取 消