Developing a WCF Service Library and Hosting it as WCF Web Service Using VS2K8
(Page 1 of 5 )
In this article, we will focus on developing a Windows Communication Foundation (WCF) library, turning it to a WCF web service, hosting it on an IIS web server and finally test it by developing a simple WCF client using Windows Forms. This article can serve as an excellent walkthrough resource for beginners.
A
downloadable zip file is available for this article.
WPF, WCF, WWF and Silverlight are the next generation components from Microsoft which revolutionize the current .NET Framework with great new and innovative architectures. I will not look into the details of the architectures of these new components as Microsoft has already added great content on the subject on its MSDN.
Please be aware that we are not directly creating a WCF web service in this article. In fact, Visual Studio 2008 beta 2 includes two templates, "WCF Service Application" and "WCF Service Library." "WCF Service Application” itself is a direct web service application relying on WCF technology (which is similar to the ASP.NET web service development). "WCF Service Library" on the other hand is a compiled component which can be deployed as a web service or a Windows service or even as a part of a customized hosting application.
In this article, we will create a WCF service library (simply a compiled WCF library), turn it into a WCF web service, host it on IIS and finally access it using a WCF client. As we would like to create a WCF service library and host it as a web service on IIS, "web.config" will be necessary during deployment.
If you have not configured IIS after installing Visual Studio 2008 beta 2, it is highly advised that you run the following (for proper mappings and automated IIS configuration):
ServiceModelReg.exe /i /x
To make this article simple, I added the "emp" to the Northwind database.
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.
Next: Creating a Windows Communication Foundation (WCF) Service Library >>
More ASP.NET Articles
More By Jagadish Chaterjee