Chapter 14. Networking and communications

 

This chapter covers

  • Working with web requests
  • Performing duplex communication
  • Consuming RESTful APIs and SOAP web services
  • Working with JSON data
  • Working with point to point and multicast sockets

Chapter 11 introduced you to the convenient data-binding mechanisms available within Silverlight. Although binding isn’t restricted to just what we’d commonly think of as data, the truth of the matter is that’s what it’s usually used for. Working with data is essential to most applications, but you have to get the data into your application somehow. This is where networking and communications come in.

Silverlight provides numerous methods to get to data hosted on other systems, from complex web services to a simple XML document. The networking and communications features of Silverlight enable you to send and receive data with a variety of technologies including SOAP services, XML, JSON, RSS, Atom, and even sockets.

We’ll start this chapter with the basics of Silverlight networking and the limitations of the browser stack. From there, we’ll look at how to connect to SOAP services and RESTful services using the browser networking stack.

With the basics under your belt, it’s then time to examine the client networking stack, introduced for out-of-browser applications but available even to applications running in-browser. This stack works around many of the limitations inherent in straight browser-based networking.

14.1. Trust, security, and browser limitations

14.2. Connecting to data sources

14.3. The client HTTP stack

14.4. Making the data usable

14.5. Using advanced services

14.6. Connecting to other Silverlight applications

14.7. Summary