O'Reilly logo

Microsoft Silverlight 5 Data and Services Cookbook by Kevin Dockx, Gill Cleeren

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calling a WCF service from Silverlight using ChannelFactory

Applies to Silverlight 4 and 5

A lot of Silverlight applications using services are typically developed using the Add Service Reference dialog box to add service references that generate the client-side proxy classes. However, this isn't sufficient or advisable for some applications or pieces of code. You might want to call variable endpoints, or you might be developing a library or a framework, in which you wouldn't want to have service references for pluggability or for extension purposes (for example, through a provider pattern).

This is where a ChannelFactory comes in handy. Through a ChannelFactory, you can combine a binding and an address from the code with a contract to open a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required