Open Visual Studio 2015 and go to File > New > Project, as shown below.
Figure-1
Go to Installed > Templates > Visual C# > WCF and select WCF Service Application. Write WelcomeWCFService and choose location for your project, followed by clicking OK, as shown in Figure-2.
Figure-2
During the project creation, Visual Studio will create some default files, as highlighted in Solution Explorer Window in Figure-3.
Figure-3
Service Contract
For Service contract detail, see WCF Service Components.
Service Implementation
It is a class, which implements Service contract (interface) and in this class, you will define your business logic or behaviors.
Configuration file
Configuration file (web.config) is the place, where you can define the end points (see the details for the end points WCF Service Components) and other configurations for your Web Service.
Rename the IService1 and Service1 by right clicking on each and select rename, as shown in Figure-4.
Figure-4
A prompt will open, which asks about the changes of all the references. Click OK and Visual Studio will automatically rename these files throughout the project

Alternatively, you can delete these files and recreate by right clicking on the project, followed by going to Add > New item, as shown below in Figure-5.
Figure-5
Now, select WCF Service. Write the name WelcomeWCFService and click Add. It will automatically generate IWelcomeWCFService and WelcomeWCFService, as shown below.
Figure-6
Add the code in IWelcomeWCFService.cs file, as highlighted below.
- namespace WelcomeWCFService {
- [ServiceContract]
- public interface IWelcomeWCFService {
- [OperationContract]
- void DoWork();
- [OperationContract]
- [WebGet(UriTemplate = "/Welcome/{name}")]
- string Welcome(string name);
- }
- }
Add the namespace for WebGet attribute (this attribute maps your methods and its parameters to the specific URL, which can be accessed through Http GET request) by clicking Quick acitons icon, as show in Figure-7.
Figure-7
Add the code in WelcomeWCFService.svc.cs file, as highlighted below.

Barath Kumar MPosted Dec 29, 2020, 9:01 AM
Thanks Rehman Shahid
Steven DeBeerPosted Jul 31, 2019, 7:28 AM
How to consume the WCF service would be nice
Anthony MaughanPosted Jun 8, 2018, 1:56 PM
This was awesome walk thru. Helped me in 1 go.
Inayat HussainPosted Apr 25, 2018, 9:16 AM
Good Work Rehman Bhai
Andrew WebbPosted Nov 22, 2017, 11:16 AM
Got it in one go. Many thanks.
sreepriya JPosted Sep 12, 2017, 12:10 AM
Well explained.. very good
Hamid KhanPosted Apr 18, 2017, 11:20 AM
Very good article Rehman. Keep it always
Former memberPosted Apr 18, 2017, 4:44 AM
Can we develop asmx legacy web service with VS IDE 2015 and 2017 ? any idea. thanks