【发布时间】:2016-05-17 21:43:13
【问题描述】:
我已确认我有权执行该请求。
根据亚马逊的Cloud Search Dev Troubleshooting Guide,我遇到的错误可能是由于 .net sdk 使用了错误的 api 版本。我看不到明确指定 api 版本的方法。
我想避免手动创建 http 请求。
我想通过 SDK 发出请求。
我已经尝试了所有可用的 SDK 版本,所有版本都给我这个错误。
我还尝试以各种组合指定请求属性。没有任何效果。
谁能指导我如何解决这个问题?
预期行为:返回所有索引字段的信息
实际行为:
错误 -
“结果消息:
Amazon.Runtime.AmazonUnmarshallingException :从 AWS 解组响应时出错。响应正文:{
"message": "行政规则禁止的请求",
"__type": "CloudSearchException"
}"
----> System.Xml.XmlException : 根级别的数据无效。第 1 行,位置 1。
代码示例:
var _configClient = new AmazonCloudSearchClient(
WebConfigurationManager.AppSettings["CloudSearchAccessKey"],
WebConfigurationManager.AppSettings["CloudSearchSecretKey"],
new AmazonCloudSearchConfig
{
RegionEndpoint = RegionEndpoint.USWest2,
ServiceURL = WebConfigurationManager.AppSettings["CloudSearchUrl"]
});
await _configClient.DescribeIndexFieldsAsync(new DescribeIndexFieldsRequest())
【问题讨论】:
标签: c# .net sdk amazon-cloudsearch