我确认我有权执行请求。在AmazonCloudSearchClient上调用DescribeIndexFieldsAsync时出错
根据亚马逊的Cloud Search Dev Troubleshooting Guide我遇到的错误可能是由于.net sdk使用错误的api版本。我没有看到明确指定api版本的方法。我想避免不得不手动创建http请求。
我想通过SDK发出请求。
我已经尝试过所有可用的SDK版本,并且他们都给我这个错误。
我也试过在各种组合中指定请求属性。什么都没有
有人可以指示我如何解决这个问题吗?
预期的行为:返回信息的所有索引字段
实际行为:
错误 - “结果消息:
Amazon.Runtime.AmazonUnmarshallingException:从AWS响应体错误解组应答回:{。 “消息”: “通过申请行政法规规定禁止”, “__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())
感谢您的建议。我没有看到.Net SDK的这种选项。在构造函数params或方法params中。 –