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

Writing and consuming a simple web service


In this recipe, let's create a simple web service using WCF and learn how to consume that service using a Phone 7 Client App.

Getting ready

Open the Visual Studio and create a new project from the template WCF Service and name it Recipe1_SimpleService. Delete the default files Service1.svc and IService1.cs from the project.

How to do it...

For this recipe, we will be creating two projects; one is a WCF Service application and the other one is a Windows Phone client application. In the Service application, we will add the service contract and operation contract. Then, we will add a simple method to return the service information. Once the service is built, we will consume that service in the Windows Phone client application to display what is returned by the method.

  1. Right-click on the project and add a new item using the project template WCF Service and name this file SimpleService.svc. The project template automatically adds the ISimpleService.cs file...