Chapter 14. Consuming the Cloud

WHAT'S IN THIS CHAPTER

  • Making basic web requests

  • Using compression to reduce the size of requests

  • Calling WCF services

  • Working with OData services in XML and JSON

While many Windows Phone services, such as location and push notification, rely on the cloud to do some or all of their processing, it's also likely that you will want to connect to other remote services. These may be services offered by your organization either on premise or in the cloud, or they may be third-party offerings that have a cloud-based API for accessing them.

In this chapter, you will learn how to integrate with Windows Communication Foundation (WCF) and Simple Object Access Protocol (SOAP) services. You will also learn how you can reduce your message overhead through the use of RESTful (Representational State Transfer) services.

HTTP REQUEST

When you need to access content from the Web, whether it be a service or static content such as images or documents, Windows Phone gives you a couple of options as to how you access this content. However, they all boil down to performing an HTTP request. Windows Phone 7 does not provide support for raw Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) socket-level communication, which means that HTTP requests are the lowest level of communication you can use. In this section, you'll learn how to use both the WebClient and HttpWebRequest classes to access content across the Web. Following this, you'll see how you can use WCF to ...

Get Professional Windows® Phone 7 Application Development: Building Applications and Games Using Visual Studio, Silverlight®, and XNA® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.