WCF - Service Application Demo - 1


WCF - Service Application Demo - 1

  • Service application is the simplest way to write, configure and consume Windows Communication Foundation (WCF) service using Visual Studio 2010
  • It will be  better understanding of WCF services which is slightly different from ASP.NET web services. 

  • To Start Microsoft Visual Studio application select File -> New -> Project.


  • In this the New Project template window appears and select the following options,
    Select Visual C# from installed templates.
    Under C# select WCF.
    Choose the framework as .Net Framework 4.
    Select Project type as WCF Service Application.
    Enter Project name as “WikiTechy_WcfService1”.
    Select Project location as “D:\wikiTechy\”.
   Enter the name for solution as“WikiTechy_WcfService1”, same as project name.
    Click “OK” button for starting the service application process. 
  • Open the Web.config file from the solution file lists.

   Web.config is automatically created by default in the project and it is part of project’s solution files.
   Service1.svc is the service contract file that hosts the service automatically on double click of this file.
  IService1.cs is the interface file for service to expose the service’s method signatures.
  The service behavior section defines the configuration to represent the behavior of a specific service. Here the element <serviceMetadata httpGetEnabled="True"/> indicates that the service publishes metadata via a HTTP/Get request. The line <serviceDebug includeExceptionDetailInFaults="False" /> indicates a flag that returns error details as part of debugging.