Developing Business Logic using the WCF Service Library with VS2K8 and ASP.NET 3.5
(Page 1 of 5 )
In this article, we will focus on developing a WCF library which performs business logic (with CRUD operations) at the middle tier level and finally access it using ASP.NET 3.5.
A
downloadable zip file is available for this article.
If you are new to WCF, I strongly recommend that you go through my previous two articles. In my first article, we focused on developing a Windows Communication Foundation (WCF) library, turning it into a WCF Web service, hosting it on an IIS web server and finally tested it by developing a simple WCF client using Windows Forms. In my second article, we focused on developing a WCF library, hosting it using a custom application and finally testing it using Windows Forms.
The entire source code for this article is available in the form of a downloadable zip file. The solution was developed using Microsoft Visual Studio 2008 Beta 2 on Microsoft Windows Server 2003 Enterprise Edition. I didn’t really test it in any other environment. I request that you post in the discussion area if you have any problems with execution.
Understanding the sample Visual Studio solution
As I already explained the step-by-step creation of WCF Service Library in my previous second article, I will not go through the details of those steps. But, before proceeding further, let us try to understand the Visual Studio solution created for this article. Below you will see a glimpse of Solution Explorer.

From the above figure, we have three different projects combined as a single solution. The name of the solution is "WCFNorthwindBLLService." It is comprised of the following three projects:
- NorthwindBLLService
- NorthwindBLLServiceHost
- WCFClientWebsite
"NorthwindBLLService" is created based on the "WCF Service Library" template. It contains the core business logic for the entire application. This project provides direct interfacing to business objects (available in it) and in turn, this directly interacts with the database.
"NorthwindBLLServiceHost" is created based on the "Windows Forms" template. It is an application which simply hosts "NorthwindBLLService" as a service. The service can be started or stopped using this simple application. You will have to start the service to make "NorthwindBLLService" work.
"WCFClientWebsite" is created based on the "ASP.NET website" template. It is a web application which accesses the "NorthwindBLLService" through "NorthwindBLLServiceHost" and finally interacts with the business classes. A service reference is added to "NorthwindBLLServiceHost" as part of its development.
Next: Understanding the WCF Service Library: Employee class >>
More ASP.NET Articles
More By Jagadish Chaterjee