简体   繁体   English

将图像从iPhone应用程序发布到宁静的WCF

[英]posting image from iphone app to restful WCF

I need to post image from ios app to .net 4 restful WCF service. 我需要将图像从ios应用发布到.net 4 Restful WCF服务。 Can someone help with following codes together (as a working package), 有人可以一起提供以下代码的帮助(作为工作包),

on .NET side: Interface code, Service code (implemenation) and web.config XML. 在.NET方面:接口代码,服务代码(实现)和web.config XML。 on IOS side: the posing to the wcf part. 在IOS方面:wcf部分的摆姿势。

although there seem to be several sources online about how to achieve this, after long time messing with it, still can't get it going. 尽管网上似乎有许多有关如何实现此目标的资料,但是经过长时间的摸索,仍然无法实现。

Thanks a lot! 非常感谢!

只需将图像作为字节数组发送到wcf服务,然后在需要存储时将其存储为SQL Server中的blob。

For the server side: take the input as a Stream - that way you can receive arbitrary data (including images). 对于服务器端:将输入作为Stream -这样,您可以接收任意数据(包括图像)。 More information in this blog post . 更多信息, 请参见此博客文章 For the client side: take a look at the NSURLRequest class - if you search for examples, you'll find many, including here from StackOverflow. 对于客户端:看一下NSURLRequest类-如果您搜索示例,则会发现很多示例,包括StackOverflow中的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM