Need help diagnosing a SOAP package issue with Amazon S3

We are creating an application that stores data in an S3 bucket. However, we are having problems with the PutObject method . Here is the xml package posted:

<?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>

      

And this is the answer we get from 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>

      

Can anyone tell me what the problem is with the SOAP package?

Thanks in advance, Dewan

+1


source to share


1 answer


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



see PutObjectInline in the s3 docs.

+2


source







All Articles