我想通过soap使用AWS S3,我查看了aws网站,有一个示例列出了所有存储桶。http://docs.aws.amazon.com/AmazonS3/latest/API/SOAPListAllMyBuckets.html。所以当我使用肥皂模板。它返回“405 Method Not Allowed”。任何帮助?感谢
这是发送给aws s3服务器的内容。
POST http://s3.amazonaws.com/ HTTP/1.1
Host: s3.amazonaws.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 497
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns="https://.s3.amazonaws.com/">
<ListAllMyBuckets xmlns="http://doc.s3.amazonaws.com/2006-03-01">
<AWSAccessKeyId>AKIAIOSFODNN7EXAMPLE</AWSAccessKeyId>
<Timestamp>2006-03-01T12:00:00.183Z</Timestamp>
<Signature>Iuyz3d3P0aTou39dzbqaEXAMPLE=</Signature>
</ListAllMyBuckets>
</soap:Body>
</soap:Envelope>
答案 0 :(得分:0)
您需要使用HTTPS,而不是HTTP。
请注意,必须使用SSL将经过身份验证和匿名的SOAP请求发送到Amazon S3。通过HTTP发送SOAP请求时,Amazon S3会返回错误。
http://docs.aws.amazon.com/AmazonS3/latest/API/APISoap.html
另请注意,不推荐使用SOAP接口。