Upload and download large files - Windows Mobile (Compact Framework) via Web Services (WCF, MTOM, WCE?)

断了今生、忘了曾经 提交于 2019-12-24 01:49:09

问题


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

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

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.

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

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?

Thanks in advance.


回答1:


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

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.

Hope that helps.



来源:https://stackoverflow.com/questions/518796/upload-and-download-large-files-windows-mobile-compact-framework-via-web-ser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!