What is Windows Communication Foundation
From msdn,Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application.
An endpoint can be a client of a service that requests data from a service endpoint.
Creating Service
Here i am creating WCF service out side of the application(ie., Toย be host in IIS, to useย service by other end)
Step 1:
Open File -> New -> Project (choose WCF Workflow Service Application) like shown below image
Step 2:
After successful creation of project, project hierarchy will shown like below
Step 3:
Let we write the operationcontract in the IService1.cs to consume in the other end point
and then define this contract in the Service1.svc.cs public string DisplayUserName(string cusName) Output : After code level completion, check whether its running correctly or not by open the Service1.svc.cs and the press F5 like below, then it will list out the service methods.
string DisplayUserName(string name);
{
return “Welcome” + cusName +”to our site!!!”;
}
Leave A Comment