Showing posts with label WCF. Show all posts
Showing posts with label WCF. Show all posts

Saturday 10 June 2017

WCF

Binding in WCF

1. Basic binding : 

This binding is provided by the basicHttpBinding class.
It is designed to expose a wcf service as an asmx web service so that told clients can consume new service.
By default it uses Http protocol for transport and encodes the message in UTF-8 text format
You can also use https with this binding

2. Web binding :

This Binding is provided by the webhttpbinding class.
It is designed to expose WCF services as http request by using  HTTP-GET,HTTP-POST.
It is used with rest based services which may give output as an xml or json format
This is very much used with social networks for implementing a syndication feed.

3. Web service(WS) binding :

This binding is provided by the wshttpbinding class
It is like as basic binding and uses http or https protocols for transport.
But this is designed to offer various ws-* specification such as ws-reliablemessaging,ws-transactions.

4. Tcp binding :

This binding is provided by NetTcpBinding class.
It uses tcp protocol for communication between two machines with ininternet(means same network).
It encodes the message in binary format.
This is faster and more reliable binding as comparedto the http protocol binding.
It is only used when communication is wcf to wcf means both client and service should have wcf

5. IPC binding :

This binding is provided by the  NetNamedPipeBinding class.
It uses named pipe for communication between  two services on the same machine
This is most secure and fastest binding among all the binding

6. MSMQ binding :

This binding is provided by  NetMsmqBinding class.
It uses MSMQ for transport and offers sup-port to  disconnected message queued.

7. Federated ws binding:

This binding is provided by the wsfederationhttpbinding class.
It is a specialized form of ws binding  and provides supports to federated security


8. Peer network binding :

This binding is provided by the netpeerTcp binding class.
It uses TCP protocol but uses peer-net-working as transport.

9. MSMQ integeration :

It is provided  by  the MSMQIntegeration binding class.
This binding  offers support to communicate with existing systems that communicate via MSMQ.

For More Reading Click Here

WCF

WCF (Windows Communication Foundation) :

1. It is a framework for building ,configuring and deploying inter operable distributed services.
2. Its code name is "Indigo".
3. It enables you to write more secure flexible services without any code change(using configuration).
    WCF = Web Service + Remoting + MSMQ + COM
    OR
    WCF = Web Service + .Net Remoting + MSMQ + COM + Enterprise Services

What is EndPoint in WCF :

EndPoint = Address(A) + Binding(B) + Contract(C)

Address : It specifies where the services is hosted.
Binding : Binding  specifies how to access the hosted service . It also specifies the transport,encoding,protocol etc.
Contract : It specifies what type of data can be sent to or received from the service.

eg. <endpoint name="BasicHttpGreetingService" address="http://localhost:5454/MyService/GeetingMyService.svc" binding="basicHttpBinding" contract="MyNamespace.MyService.IGettingService"/>


Types of Contract :

1. ServiceContract : which services are exposed to the client.
2. OperationContract : which operations the client can perform on the service.
3. DataContract : which data types are passed to and from the service,
4. MessageContract : Allow the service to interact directly with messages.
message contract can be typed or untyped and are useful in interoperability.
5. FaultContract : which errors are raised by the service and how the service handles and propagates
errors to its clients.


More Reading...!