通过Web服务(WCF,MTOM,WCE?)上载和下载大文件-Windows Mobile(压缩框架)? [英] Upload and download large files - Windows Mobile (Compact Framework) via Web Services (WCF, MTOM, WCE?)

查看:114
本文介绍了通过Web服务(WCF,MTOM,WCE?)上载和下载大文件-Windows Mobile(压缩框架)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了很多,似乎找不到一个好的稳定解决方案,因此将不胜感激.

I have searched quite a bit and can't seem to find a good stable solution, so any help will be appreciated.

这是场景: 在.NET CF 3.5上运行客户端应用程序的Windows Mobile设备(正在使用OpenNETCF库) .NET 3.5(运行IIS的Web服务器)上的Web App 在VS2008,.NET 3.5中开发-最新的

Here's the scenario: Windows Mobile device running client app on .NET CF 3.5 (OpenNETCF libraries being used) Web App on .NET 3.5 (Web server running IIS) Developing in VS2008, .NET 3.5 - all the latest

我需要使用Web服务或WCF或MTOM在移动设备之间传输大型文件. (大概是分块的).我找到了一些不错的文章,但似乎无法正常工作,带有XML数据的常规Web服务给出了内存异常,WCE在VS2008中不可用,CF上的WCF没有给我添加服务引荐",只有"Web引荐",我无能为力.

I need to use web services or WCF or MTOM to transfer large files to and from the mobile device. (Prefferably chunked). I've found some great articles, but can't seem to get it working right, normal web services with XML data gives out of memory exception, WCE is not available in VS2008, WCF on CF is not giving me the option to add "Service referrence", only "Web referrence", I'm at my wits' end.

有人说,不要使用WSE,它已经过时了,仅使用WCF,但我无法使其在移动应用程序上运行.

Some say, don't use WSE, it is outdated, only use WCF but I can't get it running on the mobile app.

我需要的是从移动设备到Web服务器的简单的上/下传输机制,稍后我将介绍压缩和可靠性.

All I need is a simple up/down transfer mechanism from mobile device to web server, I can look at compression and reliablity later.

有人可以通过一些文章和示例代码向我指出正确的方向吗?

Can anyone please point me in the right direction with some articles and sample code?

谢谢.

推荐答案

在过去,我发现Web服务,WCF,MTOM和WSE为大型文件传输提供了糟糕的解决方案.尤其是对于上传.

In the past, I found that web services, WCF, MTOM and WSE provided terrible solutions for large file transfers. Particularly for uploading.

我最终要做的是创建一个客户端/服务器TCP连接,并在流中发送文件的二进制数据.我在文件数据之前添加了标头和xml字符串,它们详细说明了文件数据.就我而言,我需要一个安全级别,因此我使用了System.Net.Security.NegotiateStream.在您的情况下,System.Net.Sockets命名空间的TcpClient和TcpListener可能就足够了.它们都受CF 3.5支持.

What I ended up doing was creating a client/server TCP connection and sending the file's binary data across the stream. I preceded the file data with a header and xml string which detailed the file data. In my case I required a level of security so I used the System.Net.Security.NegotiateStream. In your case, the TcpClient and TcpListener of the System.Net.Sockets namespace might suffice. They are both supported by CF 3.5.

希望有帮助.

这篇关于通过Web服务(WCF,MTOM,WCE?)上载和下载大文件-Windows Mobile(压缩框架)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆