如何在 Windows Phone 7 上使用 SOAP API 将对象放在亚马逊 S3 上?
我在 Windows Phone 7 上使用 S3 API 时遇到了困难,主要是因为缺乏使用 SOAP API 将对象实际放置在 S3 上的示例?
你甚至把物品的主体放在哪里?据我所知,putObject 方法中甚至没有一个字段...
(PutObjectAsync(string Bucket, string Key, MetadataEntry[] Metadata, long ContentLength, Grant[] AccessControlList, Exam_Helper.AWS.StorageClass StorageClass, string AWSAccessKeyId, System.DateTime Timestamp, string Signature, string Credential, object userState))
那么,如何使用 Windows Phone 7 将对象放在 S3 上。
I'm having a hard time consuming the S3 API on Windows phone 7, mainly because of the lack of example for actually putting an object on S3 using the SOAP API?
Where do you even put the body of the item? As far as I know, there isn't even a field for it in the putObject method...
(PutObjectAsync(string Bucket, string Key, MetadataEntry[] Metadata, long ContentLength, Grant[] AccessControlList, Exam_Helper.AWS.StorageClass StorageClass, string AWSAccessKeyId, System.DateTime Timestamp, string Signature, string Credential, object userState))
So, how do you put an object on S3 with windows phone 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不建议直接从手机访问 S3 API(或 Azure 存储 API)。
如果您尝试这样做,那么您将需要拥有公共 PUT 权限,或者您将在 XAP 文件中以简单的方式查看您的私人存储访问密钥 - 黑客将容易窃取这些并您很快将付费托管 PimpMyBreasts、WikiL33ked 和 SpamThis。
相反,您应该托管自己的存储服务,至少可以对上传的内容进行一些安全检查。
如果您坚持直接使用 S3,那么本文将介绍 C# 中的 S3,包括 PutObject 请求 - http ://www.codeproject.com/KB/cs/s3_ec2studio.aspx
好运
祝斯图尔特
I do not recommend accessing the S3 API (or the Azure Storage API) direct from your phone.
If you try this, then you will need to either have public PUT permissions or you will have your private storage access keys in plain view in the XAP file - it will be easy for a hacker to steal these and you will soon be paying to host PimpMyBreasts, WikiL33ked and SpamThis.
Instead, you should host your own storage service where you can at least put some security checks in about what is being uploaded.
If you do insist on using S3 directly, then this article covers S3 from C# including PutObject requests - http://www.codeproject.com/KB/cs/s3_ec2studio.aspx
Good luck
Stuart
我假设您在项目中添加了对 Amazon 服务的服务引用:
http ://s3.amazonaws.com/doc/2006-03-01/AmazonS3.wsdl
添加为服务引用后,您可以调用
AmazonS3Client.PutObjectInlineAsync
在 a 中上传对象。 S3桶。Data
参数(接受byte
数组)就是您要查找的内容。推荐阅读:
http://timheuer .com/blog/archive/2008/07/05/access-amazon-s3-services-with-silverlight-2.aspx
I assume that you added a service reference to the Amazon service in your project:
http://s3.amazonaws.com/doc/2006-03-01/AmazonS3.wsdl
Once added as a service reference, you can invoke
AmazonS3Client.PutObjectInlineAsync
to upload an object in a S3 bucket. TheData
parameter (accepts abyte
array) is what you're looking for.Recommended reading:
http://timheuer.com/blog/archive/2008/07/05/access-amazon-s3-services-with-silverlight-2.aspx