WCF Guidance for Mobile Developers
Michele Leroux Bustamante and Nickolas Landry, May 2009
wcfguidanceformobile.codeplex.com Page 4
Windows Mobile 6.1 is the latest operating platform from Microsoft for running mobile applications – be
they standalone or connected. Mobile smart clients built for Windows Mobile using the .NET Compact
Framework can use a number of different technologies for remote communications including text
messaging, email-based transports, sockets, and web services. Today, Windows Communication
Foundation (WCF) is the preferred technology for building connected applications – a subset of which is
available in the .NET Compact Framework 3.5. The goal of this whitepaper is to help developers build
mobile smart clients for Windows Mobile 6 using WCF to communicate with remote server resources.
Specifically, this paper will explain how to design and implement WCF services so that they can be
consumed by .NET Compact Framework applications running on Windows Mobile devices and show you
how to work with the subset of WCF on mobile devices to consume those services.
For those new to mobile development we will provide an overview of the platform tools available along
with instructions to set up your development environment as it relates to the scenarios we will be
describing in this whitepaper. We’ll also walk you through creating and hosting a simple WCF service
and generating a proxy to consume that service from a mobile device – so if you are new to WCF you
will be able to follow along. We will then discuss specific considerations related to WCF and mobile
development including contract design and serialization, binding configuration for endpoints, hosting
options, proxy generation, exception handling, and security. In addition, we will discuss how to consume
REST-based WCF services from your mobile applications.
The State of Windows Mobile Today
Mobile devices, just like any desktop or server computer, require an operating system to run. Mobile
.NET applications run as managed code under the care of the .NET Compact Framework, which in turn
runs on top of a specific embedded operating system. Just like the .NET Framework was designed and
built to run on top of various flavors of Windows, like Windows Vista, Windows 7 or Windows Server
2008 - the .NET Compact Framework was designed and built to run on top of mobile and embedded
device-specific versions of Windows: Windows CE.
Microsoft Windows CE is a scaled-down and modular version of the Windows NT core operating system
targeted at a wide range of innovative, small-footprint devices including consumer electronics,
gateways, industrial controllers, mobile handheld devices, Internet Protocol (IP) set-top boxes, voice
over Internet protocol (VoIP) phones and thin clients. Windows CE features a multithreaded 32-bit
kernel and an open architecture optimized for real-time, and has the power to drive serious applications
in any kind of device. With its scalable model, Windows CE can scale up to power feature-rich devices
and appliances, and scale down to less than 1 MB to provide basic but powerful system services in very
compact form factors.
Windows CE’s modularity also allows device manufacturers to decide which components of the OS they
want to include. The device manufactures can thus streamline their respective devices by excluding
unnecessary modules and libraries that would add little value for the end user.