Wednesday, October 27, 2010

Beginner - use WCF Service in Silverlight application

We will create a WCF service in the WEB project and use it in Silverlight application.

You can download the sample project.

Tools:
1. Visual Studio 2010 (Silverlight tools installed)
More info visit: http://www.silverlight.net/getstarted/

Create new project:


Project Structure:


Add WCF service to WEB project:




Write WCF service method:


Silverlight UI:


Add WCF Service reference into Silverlight project:

**Build WEB application before adding Service reference








Initiate and call WCF service method:





Sample Output:


Before Publishing:
















Download Source