Architect 2 : Calling WCF Services in Your Data Access Layer
After you have completed an N-tier Silverlight application (check my blog: http://weblogs.asp.net/stanleygu/archive/2009/12/20/building-n-tier-silverlight-application.aspx ), your company decides to outsource sql server database development and management to a third party vendor. In your data access layer, instead of calling the sql server database directly, you will need to call the WCF services provided by the vendor.
1. At your data access layer, add Service Reference using the vendor’s WCF Service URL and name it CustomerServiceReference.
2. The Visual Studio 2008 IDE adds an app.config for you automatically.
3. Copy the content of the app.config to your Web.config and do modification if necessarily.
4. Remove the app.config file.
5. Locate the method of GetCustomers and remove its old code.
6. Add new code calling the WCF service to the GetCustomers method.