简体   繁体   中英

Best way for an asp.net mvc application to communicate with client (mobile devices with windows mobile)

I have a client server app, the server side is asp.net mvc and the client side is a mobile device with windows mobile 6. Basically, the client authenticates, gets some data, create a databse, makes some operations on it then sends the data back to the server (Login, Download, Upload).

I get/send data from the client using HttpWebRequest class and i do like this: when the client requests data i write those objects in files using FileHelpers and in the end i make a .rar from all those files and i write those bytes in the response stream and on the client i unrar and get the objects from files using FileHelpers again.The same is happening for the Upload operation.

What is the best way to realize this communication because i think it's kinda horse shit what i'm doing in there, or?

Glenn Block just did a very good post on streaming content over WCF:

http://blogs.msdn.com/b/gblock/archive/2010/11/24/streaming-over-http-with-wcf.aspx

I really like WCF Data Services & oData personally and they support binary objects and streaming:

http://msdn.microsoft.com/en-us/library/ee473426.aspx http://blogs.msdn.com/b/astoriateam/archive/2010/09/08/data-services-streaming-provider-series-part-2-accessing-a-media-resource-stream-from-the-client.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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