So, let's see step by step how to do WCF.
Step 1: Go to Visual Studio 2010 – crete a new website; select WCF service; give it a name.
Step 2: Go to Iservice.cs and write this code:
{
[OperationContract]
int Add(int a, int b);
[OperationContract]
int Mul(int a, int b);
}
Step 3: Now go to Service .cs and write this one:
{
public int Add(int a, int b)
{
return a + b;
throw new NotImplementedException();
}
public int Mul(int a, int b)
{
return a * b;
throw new NotImplementedException();
}
}
Step 4: Now add a Console application; go to file on IDE; add New project; Console application.
Step 5: Go to the Console application and right-click; add a service reference; use the Discover option; click on Discover; give a namespace like SR.
Step 6: Now write this code in the program.cs:
{
public int Add(int a, int b)
{
return a + b;
throw new NotImplementedException();
}
public int Mul(int a, int b)
{
return a * b;
throw new NotImplementedException();
}
}
Step 7: Run the Application.

Bhuvanesh MohankumarPosted Jun 21, 2016, 7:35 AM
Good one
JeetPosted Oct 16, 2012, 5:37 AM
Please elaborate more step-5. in discover tab nothing appera :( can nt proceed further....
marekwPosted Jun 12, 2011, 3:04 PM
Good article, but could you elaborate more on steps 5-7? How I should code this console application?