Book Image

Windows Phone 7.5 Data Cookbook

By : Ramesh Thalli
Book Image

Windows Phone 7.5 Data Cookbook

By: Ramesh Thalli

Overview of this book

Windows Phone 7.5 Mango contains support for apps written in Silverlight or XNA. These apps can store data on the device, and also load and manipulate data from "the cloud" and other web services.This Windows Phone 7.5 Data Cookbook has a range of recipes to help you apply data handling concepts. You will be able to apply the knowledge gained from these recipes to build your own apps effectively. This Windows Phone 7.5 Data Cookbook starts with data binding concepts at the UI layer and then shows different ways of saving data locally and externally in databases. The book ends with a look at the popular MVVM software design pattern. The recipes contained in this book will make you an expert in the areas of data access and storage.
Table of Contents (15 chapters)
Windows Phone 7.5 Data Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building a simple REST service


In the last two recipes, we understood how to call simple REST-based web services using WebClient classes. In this recipe, let's build a simple REST service and a client to understand how easy and simple the REST architecture is. We will use the WebMatrix to build the web service and stream the result using JSON (Java Script Object Notation) format.

Getting ready

To create the web service we will be using Microsoft's WebMatrix tool, as it is a simple and a free tool for building server-side applications. Install it using the Platform Installer at this location: http://www.asp.net/web-pages.

How to do it...

Let's build a simple MyLinks service using the WebMatrix and MyLinks client using the Phone 7 application to consume the service.

  1. Open the WebMatrix and create a website using a blank template and name it MyLinks site, as shown in the following screenshot:

  2. Click on Databases from the Navigation bar at the bottom to add a local database. The local database has...