1

我们正在构建一个将数据存储在 S3 存储桶中的应用程序。但是,我们遇到了PutObject方法的问题。这是我们发送的 xml 数据包:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <PutObject xmlns="http://doc.s3.amazonaws.com/2006-03-01">
         <Bucket>lills</Bucket>
         <Key>lills123</Key>
         <Metadata>
            <Name>Content-Type</Name>
            <Value>text/plain</Value>
         </Metadata>
         <Metadata>
            <Name>title</Name>
            <Value>lills</Value>
         </Metadata>
         <Data>aGEtaGE=</Data>
         <ContentLength>5</ContentLength>
         <AWSAccessKeyId>key</AWSAccessKeyId>
         <Timestamp>2008-11-12T06:23:17Z</Timestamp>
         <Signature>signature</Signature>
      </PutObject>
   </soap:Body>
</soap:Envelope>

这是我们从 S3 得到的响应:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Client.badRequest</faultcode>
         <faultstring>Malformed request</faultstring>
         <detail/>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

谁能告诉我 SOAP 数据包的问题是什么?

在此先感谢,德文

4

1 回答 1

2

If you want to send the data in the SOAP message itself, you need to use PutObjectInline, and not PutObject (which expects the data to be a DIME attachment).

see PutObjectInline in the s3 docs.

于 2008-11-27T19:21:59.393 回答