So, let's get ready to start it off.
Question arises: What is an Endpoint?
Let's Break Up and Understand answer for this clearly

Figure 1: Describing Endpoint Diagrammatically.
In Simple terms looking at this above figure we can logically say, it is combination of address, binding and contracts.
Question arises: What does Address do?
This Person say: "I am Here to intimate the client to know where the WCF Service is located".
Question arises: What does Binding do?
This Person say: "I am Here to intimate the client to know, how the WCF Service Communicates with Request and Response"
Question arises: What does Contract do?
This Person say: "I am Here to intimate the client to know, what type of operation does this particular service does".
Question arises: What is Default Endpoint?
As, per the above part of this article we are now well grasped grip of what is an endpoint. Similarly, in WCF 4.0 one of the interesting features has been emerged and made life bit easier. It's the default endpoint. It enables to choose the Endpoint based on implemented service by default without user's attention. I mean user does not have to go and manually specify an endpoint for the service, so here in WCF 4.0 it's all automatically done without creating much overhead.
The Complete Code of IService1.cs looks like this:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Runtime.Serialization;
using
System.ServiceModel;
using
System.ServiceModel.Web;
using
System.Text;
namespace
Arthimetic_Applcation
{
// NOTE: You can use the "Rename" command on the "Refactor"
menu to change the interface name "IService1" in both code and config file
together.
[ServiceContract]
public interface
IService1
{
[OperationContract]
double Add(double
a, double b);
[OperationContract]
double Sub(double
a, double b);
[OperationContract]
double Mul(double
a, double b);
[OperationContract]
double Div(double
a, double b);
}
}
The Complete Code of Service1.svc looks like this:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Runtime.Serialization;
using
System.ServiceModel;
using
System.ServiceModel.Web;
using
System.Text;
namespace
Arthimetic_Applcation
{
// NOTE: You can use the "Rename" command on the "Refactor"
menu to change the class name "Service1" in code, svc and config file together.
public class
Service1 : IService1
{
public double
Add(double a, double
b)
{
return a + b;
}
public double
Sub(double a, double
b)
{
return a - b;
}
public double
Mul(double a, double
b)
{
return a * b;
}
public double
Div(double a, double
b)
{
return a / b;
}
}
}
The Complete Code of Web.Config looks like this:
<?xml
version="1.0"?>
<configuration>
<system.web>
<compilation
debug="true"
targetFramework="4.0"
/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid
disclosing metadata information, set the value below to false and remove the
metadata endpoint above before deployment
-->
<serviceMetadata
httpGetEnabled="true"/>
<!--
To receive exception details in faults for debugging purposes, set the value
below to true. Set to false before deployment to avoid disclosing exception
information -->
<serviceDebug
includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment
multipleSiteBindingsEnabled="true"
/>
</system.serviceModel>
<system.webServer>
<modules
runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
The Complete Code of WebForm1.aspx looks like this:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Default_Endpoint.WebForm1" %>




Sonakshi SinghPosted Jan 9, 2012, 11:13 PM
Good job...keep presenting
Vikas MishraPosted Jan 9, 2012, 12:59 PM
Thanks Vijay for sharing such a nice article
Amit MaheshwariPosted Jan 9, 2012, 12:30 PM
It's a great effort to accomplish such task keep it up and thanks for sharing......
Akash AhlawatPosted Jan 9, 2012, 11:48 AM
Though I've used WCF quite often, I've never thought to have a simple program like this to have this chat functionality, I'm sure I'll give it lots of use.
Arjun PanwarPosted Jan 9, 2012, 11:01 AM
Thanks Mr. Vijay for sharing
Monika AroraPosted Jan 9, 2012, 3:38 AM
Very nicely presented article.