MSDN Magazine Launch Issue - February 15, 2008 - (Page 36) Andrew Arnott Mobile Write An IM App With The .NET Compact Framework n addressability problem with mobile devices has traditionally made it difficult to write Windows Mobile® applications that would receive data pushed down from servers. Small devices often do not have static IP addresses or dynamic DNS entries that follow them around. A common workaround has been for the device to send an HTTP request to the server when the device comes online, and the server then lets that request wait until it has something to push down to the device. The server then responds to that long-standing request with the update, and the device processes the update and sends out another request to wait for the next update. This workaround can cause scalability problems on the server since it has to hang onto many requests at once instead of responding to them right away and closing the connections. It can also reduce the battery life of the device, which must stay on to maintain the connection. If the device isn’t on when an update from the server is ready, the server has no way to send the update and either must drop the update or maintain state on which devices have which updates. Finally, the application has no way to send or receive messages if the network is not available. Visual Studio® 2008 gives developers of Windows Mobile applications the ability to access a subset of Windows® Communication Foundation (WCF) functionality via the Microsoft® .NET Compact Framework 3.5, which solves many of these problems with two 36 msdnmagazine new binding elements to WCF that facilitate sending and receiving messages using e-mail as the transport. Since many devices already have e-mail sync functionality, these transports take advantage of the inherent queuing nature of e-mail and the availability of e-mail servers already set up on the Internet to create an addressable message queue that enables peer-to-peer, device-toserver, and server-to-device message-level communication in a true message-push fashion. In this article, I will outline the subset of WCF that is supported by the .NET Compact Framework 3.5 WCF This article uses the following technologies: .NET Compact Framework 3.5, Visual Studio 2008 This article discusses: Mail transports in the .NET Compact Framework ✥ Writing simple messaging applications ✥ Inside the WCF messaging plumbing ✥ Consuming a WCF Web service ✥ Code download available at: msdn.microsoft.com/msdnmag/code08.aspx Andrew Arnott has been programming using Microsoft technologies for 12 years, and his favorite pastime frameworks include WCF, WPF, and ASP.NET. He is currently working for Microsoft as a Software Development Engineer for the .NET Compact Framework. Andrew is married to his lovely wife, Cheryl, and has one son, who is less than a year old. http://msdn.microsoft.com/msdnmag/code08.aspx http://ASP.NET
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.