public interface IGetEmployee
{
[OperationContract(Name = "GetEmployeeDetailsById")]
List
[OperationContract(Name = "GetEmployeeDetailsByName")]
List
}
If we want to summarize in one sentence, the difference between WsHttpBinding
and BasicHttpBinding
is that WsHttpBinding
supports WS-* specification. WS-* specifications are nothing but standards to extend web service capabilities.
Below is a detailed comparison table between both the entities from security, compatibility, reliability and SOAP version perspective.
Criteria | BasicHttpBinding | WsHttpBinding |
Security support | This supports the old ASMX style, i.e. WS-BasicProfile 1.1. | This exposes web services using WS-* specifications. |
Compatibility | This is aimed for clients who do not have .NET 3.0 installed and it supports wider ranges of clients. Many of the clients like Windows 2000 still do not run .NET 3.0. So older version of .NET can consume this service. | As its built using WS-* specifications, it does not support wider ranges of client and it cannot be consumed by older .NET version less than 3 version. |
Soap version | SOAP 1.1 | SOAP 1.2 and WS-Addressing specification. |
Reliable messaging | Not supported. In other words, if a client fires two or three calls you really do not know if they will return back in the same order. | Supported as it supports WS-* specifications. |
Default security options | By default, there is no security provided for messages when the client calls happen. In other words, data is sent as plain text. | As |
Security options |
|
|
One of the biggest differences you must have noticed is the security aspect. By default, BasicHttpBinding
sends data in plain text while WsHttpBinding
sends it in encrypted and secured manner.
Interfaces are better suited to situations in which your applications require many possibly unrelated object types to provide certain functionality.
Interfaces are more flexible than base classes because you can define a single implementation that can implement multiple interfaces.
Interfaces are better in situations in which you do not have to inherit implementation from a base class.
Interfaces are useful when you cannot use class inheritance. For example, structures cannot inherit from classes, but they can implement interfaces.
Transactions provide a way to group a set of actions or operations into a single indivisible unit of execution. A transaction is a collection of operations with the following properties: