O'Reilly logo

Silverlight 4 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

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 code with a contract to open a channel to a service endpoint that implements ...

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