이것은 스로틀 한도에 도달하면 발생합니다.
는 시도의 catch 블록
예에 코드를 마무리하려고합니다.
void withretry(string query)
{
ListMatchingProductsRequest request = new ListMatchingProductsRequest();
request.SellerId = amazonsetting.merchantId;
request.MarketplaceId = amazonsetting.marketplaceId;
request.QueryContextId = "Books";
request.Query = query;
try
{
ListMatchingProductsResponse response = amazonsetting.service.ListMatchingProducts(request);
if (response.IsSetListMatchingProductsResult())
{
ListMatchingProductsResult listMatchingProductsResult = response.ListMatchingProductsResult;
if (listMatchingProductsResult.IsSetProducts())
{
ProductList products = listMatchingProductsResult.Products;
List<Product> productList = products.Product;
Product product = productList[0];
if (product.IsSetIdentifiers())
{
IdentifierType identifiers = product.Identifiers;
if (identifiers.IsSetMarketplaceASIN())
{
ASINIdentifier marketplaceASIN = identifiers.MarketplaceASIN;
if (marketplaceASIN.IsSetMarketplaceId())
{
}
if (marketplaceASIN.IsSetASIN())
{
asin = marketplaceASIN.ASIN;
}
}
}
if (product.IsSetAttributeSets())
{
foreach (var attribute in product.AttributeSets.Any)
{
msg += ProductsUtil.FormatXml((System.Xml.XmlElement)attribute);
}
}
}
parsemsg();
}
}
catch (Exception ex)
{
string type = ex.Message;
if (type=="Request is throttled")
{
if (cnt<=maxretry)
{
cnt++;
withretry(query);
}
}
}
}
maxretry에 도달 할 때까지 계속 시도합니다.
빠른 답장을 보내 주셔서 감사합니다 .i는 결과를 알려 드리겠습니다. – samiaj
고맙습니다. 내게 – samiaj
이 도움이 되었으면 수락으로 표시했습니다. – Ratna