Hi
On Fri, Jan 31, 2014 at 6:04 PM, Rasika Hettige <[email protected]> wrote: > Hi, > > In AmazonS3 REST API, "PUT Bucket policy" method expects a dynamic JSON > array to create bucket policies. > Is it a best practice to send dynamic JSON array through SOAP request as > below? > Please note that the policies change from each other and does not have a > fix > nature. > > Please guide us, if the following way is not a good practice. > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/ > " > xmlns:urn="wso2.connector.amazons3.createbucketpolicy"> > <soapenv:Header/> > <soapenv:Body> > <urn:accessKeyId>AKIAIGURZM7GJ7TRO6KQ</urn:accessKeyId> > > > <urn:secretAccessKey>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</urn:secretAccessKey> > <urn:methodType>PUT</urn:methodType> > <urn:contentType>application/json</urn:contentType> > <urn:bucketName>imagesBucket5</urn:bucketName> > <urn:xAmzDate>true</urn:xAmzDate> > <urn:bucketUrl>http://s3.amazonaws.com/imagesBucket5</urn:bucketUrl> > <urn:uriRemainder>/?policy</urn:uriRemainder> > <urn:bucketPolicy>{ > "Version":"2012-10-17", > "Statement":[ > { > "Sid":"Policy1", > "Effect":"Allow", > "Principal": { > "AWS": "*"}, > "Action":["s3:GetObject"], > "Resource":"arn:aws:s3:::imagesBucket5/*", > "Condition":{ > "StringLike":{ > "aws:Referer":[ > "http://www.example.com/*", > "http://example.com/*" > ] > } > } > } > ] > }</urn:bucketPolicy> > </soapenv:Body> > </soapenv:Envelope> > No this is absolutely wrong, you can not send something like this its not compliance to the RESTful protocol, I am not quite sure what you trying to achieve by embedding JSON content inside SOAP ..if that's a RESTful API you should absolutely need to have a clear idea on how RESTful API can be called please refer please do study [1] [1] http://docs.wso2.org/display/ESB480/JSON+Support and as Imesh mention you shoul call http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTpolicy.htmlwithout messing any SOAP with RESTful invocations. > > > > -- > View this message in context: > http://wso2-oxygen-tank.10903.n7.nabble.com/Pass-JSON-array-through-SOAP-Request-tp91556.html > Sent from the WSO2 Development mailing list archive at Nabble.com. > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > -- Dushan Abeyruwan | Associate Tech Lead Integration Technologies Team PMC Member Apache Synpase WSO2 Inc. http://wso2.com/ Blog:http://dushansview.blogspot.com/ Mobile:(0094)713942042
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
