我正在尝试通过MWS API检索订单报告。为此,我必须提交报告请求。无论我如何准备请求,我都会遇到同样的错误:
The service cannot handle the request. Request is invalid.
我正在使用亚马逊客户端库。这是我们用来打电话的代码:
public InvokeSubmitReportResponse InvokeSubmitOrderReportRequest(DateTime startDate, DateTime endDate)
{
RequestReportRequest callrequest = new RequestReportRequest();
RequestReportResponse callresponse = new RequestReportResponse();
InvokeSubmitReportResponse response = new InvokeSubmitReportResponse();
callrequest.Merchant = sellerId;
callrequest.MarketplaceIdList = new IdList();
callrequest.MarketplaceIdList.Id = new List<string>(new string[] { marketPlaceId });
callrequest.StartDate = startDate;
callrequest.EndDate = endDate;
callrequest.ReportType = "_GET_ORDERS_DATA_";
try
{
callresponse = service.RequestReport(callrequest);
response.CallStatus = true;
response.EndDate = callresponse.RequestReportResult.ReportRequestInfo.EndDate;
response.ReportProcessingStatus = callresponse.RequestReportResult.ReportRequestInfo.ReportProcessingStatus;
response.ReportRequestId = callresponse.RequestReportResult.ReportRequestInfo.ReportRequestId;
response.ReportType = callresponse.RequestReportResult.ReportRequestInfo.ReportType;
response.Scheduled = callresponse.RequestReportResult.ReportRequestInfo.Scheduled;
response.StartDate = callresponse.RequestReportResult.ReportRequestInfo.StartDate;
response.SubmittedDate = callresponse.RequestReportResult.ReportRequestInfo.SubmittedDate;
}
catch (MarketplaceWebServiceException ex)
{
response.CallStatus = false;
response.Error = ex;
}
return response;
}
在this 文档中,它告诉我唯一必需的参数是ReportType
。如果我注释掉请求中的所有其他参数,我会收到SellerId is required
错误。如果我仅使用ReportType
和Merchant
提交请求,则会收到The service cannot handle the request. Request is invalid.
错误,如果我通过了我要传递的所有参数,就会这样做。我检查了帐户识别参数,它们都是正确的。
任何人都可以建议问题是什么吗?
更新
我在使用亚马逊便笺簿时遇到同样的错误,所以我假设他们有一个错误。
答案 0 :(得分:1)
_GET_ORDERS_DATA_
也称为“预定XML顺序报告”。我没试过,但我相信你不能要求提供这种类型的报告。预定报告旨在与ManageReportSchedule调用一起使用,这将允许您创建此类计划。此类报告(GetReport调用等)的进一步处理与请求的报告相同。