Deploy a Custom WCF into SharePoint2010—Part 3
In the first 2 parts of this series, I showed you how to deploy custom WCF deploy into SharePoint and consume such WCF in a console application. In this post I would like to show you how to consume the same WCF service in a Silverlight application. You can download the source code here
1. Create Silverlight application and add the WCF references as below. (I know I told you it is not a good practice to consume WCF in this way when you have control over both WCF server side and client side and both server and client side are written using .net, it is a little bit harder to consume the WCF services in Silverlight in this way as you cannot add non-Silverlight class assembly to the Silverlight project.).
2. Add 2 labels controls and one button control to the form and add the following code to the button click event.
3. Deploy the Silverlight into SharePoint by creating SharePoint module item template and add the Silverlight to a sitepage. For details of the configuration, check my previous blog post here.