我在.NET應用程序中使用了簡單的AWS SDK for .NET文檔示例,以列出我的存儲桶並收到下面的錯誤消息。我可以創建桶和上傳文件,但我不能做任何列表/獲取桶/對象?有人可以幫我嗎?謝謝。適用於.NET的AWS開發工具包ListBuckets錯誤
錯誤消息 - XML文檔(2,2)中存在錯誤。沒有料到「
錯誤堆棧跟蹤 - -
ERROR內部異常。在System.Xml.Serialization.XmlSerializer.Deserialize(的XmlReader XmlReader中,字符串的encodingStyle,XmlDeserializationEvents事件)\ r \ n在的System.Xml.Serialization Amazon.S3上的Amazon.S3.AmazonS3Client.processRequestResponse [T](HttpWebResponse httpResponse,S3Request請求,類型t,T &響應,異常&原因)\ r \ n中的.XmlSerializer.Deserialize(XmlReader xmlReader) AmazonS3Client.handleHttpResponse [T](S3Request userRequest,HttpWebRequest請求,HttpWebResponse httpResponse,Int32重試,Int64 lengthOfRequest,T &響應,異常&原因,HttpStatusC ode & statusCode)\ r \ n at Amazon.S3.AmazonS3Client.getResponseCallback [T](IAsyncResult result)\ r \ n at Amazon.S3.AmazonS3Client.endOperation [T](IAsyncResult result)\ r \ n at Amazon.S3 .AmazonS3Client.EndListBuckets(IAsyncResult的asyncResult個)\ r \ n在Amazon.S3.AmazonS3Client.ListBuckets(ListBucketsRequest請求個)\ r \ n在Amazon.S3.AmazonS3Client.ListBuckets(個)\ r \ n
// CODE
using (AmazonS3 amazonS3 = SetAmazonS3Client())
{
using (ListBucketsResponse response = amazonS3.ListBuckets())
{
foreach (S3Bucket bucket in response.Buckets)
{
Console.WriteLine("You own Bucket with name: {0}", bucket.BucketName);
}
}
}
我正在使用AWSSDK.dll 1.4.10.0,並且存儲桶名稱與dummybucket類似,我如何通過Google API Console查看IAM用戶的權限?我打開了「互操作訪問」並生成了訪問和密鑰,但我不知道這些與用戶有關? – user1435373