What is Binding in WCF service?Binding defines how the client will communicate with WCF service. Binding tell about three things in communication. There are different binding available in WCF like basiHttpBinding, wsHttpBinding, TCP,....
1. Transport Protocol (ex - HTTP, TCP, NamedPipe, MSMQ)
2. Message Encoding ( ex. text/Xml, Binary)
3. Protocol (ex. reliable messaging, transport support)
In WCF you can create your custom binding also.
For speed you can choose netTCP binding, if you have same platform on both end.
For communication client and WCF service should same configuration entry.
Configure WCF service endpoint dynamically in code
Endpoint and behavior setting can be write in code instead of config file.
As depicted below. It is written in host.
ServiceMetadataBehavior serviceMetadataBehavior = new ServiceMetadataBehavior()
host.AddServiceEndpoint(typeof(CalculatorService.ICalculatorService), new BasicHttpBinding(), "CalculatorService");
WriteLine("Host Started @ " + DateTime.Now.ToString());
And app.config file would defined as below