Chapter 6. Passing Entities via WCF

Silverlight 2 can communicate with SOAP-based web services such as ASMX web services and WCF web services using basicHttpBinding, as you learned in Chapter 5. That chapter shows how to create SOAP-based services with .NET and communicate with them from a Silverlight application. The examples create simple services that pass scalar type values. Web services can also pass complex structures such as instances of classes, lists of classes, and even graphs (classes that contain other classes as part of a hierarchy). These classes often are part of a domain model that contains class entities.

Whether the entities are created through custom code or through a generation tool such as LINQ to SQL or NHibernate, the entities can be passed across physical tiers to a Silverlight client application. This chapter discusses multitiered architecture with Silverlight applications and the role of domain model entities. It also demonstrates how to pass entities between Silverlight applications and WCF services, and provides tips on how to configure the services and their data models to work well and be consumable by Silverlight.

Passing Entities Between Physical Tiers

Passing complex structures such as entities or lists of entities using Web Communication Foundation (WCF) is a common request and is easily handled using WCF and Silverlight. The following scenarios describe the process and demonstrate how to return entities gathered from custom class models, and entities ...

Get Data-Driven Services with Silverlight 2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.