WCF Interview Questions Part_1

1)What is WCF?

First let us give a short answer to this: - “WCF (Indigo was the code name for WCF) is a unification of .NET framework communication technologies “.WCF is a unification technology, which unites the following technologies:-
• NET remoting
• MSMQ
• Web services
• COM+.
Below figure depicts WCF fundamentals pictorially.


---------------------------------------------------------------------

2)What are bindings?
Ans)
Bindings specify how a Windows Communication Foundation (WCF) service endpoint communicates with other endpoints. At its most basic, a binding must specify the transport (for example, HTTP or TCP) to use. You can also set other characteristics, such as security and transaction support, through bindings.
Here we have 9 types of binidings and this binding classes are under the
System.ServiceModel namespase
Binding type
Class name under  “System.ServiceModel” namespase

Basic Binding

BasicHttpBinding

TCP Binding

NetTcpBinding

Peer Network Binding

NetPeerTcpBinding 

IPC Binding

NetNamedPipeBinding

Web Service (WS)  Binding

WSHttpBinding

Federated WS Binding

WSFederationHttpBinding

Duplex WS Binding

WSDualHttpBinding

MSMQ Binding

NetMsmqBinding

MSMQ Integration Binding

MsmqIntegrationBinding



-------------------------------------------------------------------------------------------------------

3)      Which specifications does WCF follow?
Ans)

WCF supports specifications defined by WS-* specifications. WS-* specifications are defined together by Microsoft, IBM, SUN and many other big companies so that they can expose there service through a common protocol. WCF supports all specifications defined we will understand them one by one.

1.Messaging (WS-Addressing):- SOAP is the fundamental protocol for web services. WS Addressing defines some extra additions to SOAP headers, which makes SOAP free from underlying transport protocol. One of the good things about Message transmission is MTOM, also termed as Message Transmission Optimization Mechanism. They optimize transmission format for SOAP messages in XML-Binary formant using XML optimized packaging (XOP). Because the data will sent in binary and optimized format, it will give us huge performance gain.

2.Security (WS-Security, WS-Trust, and WS-Secure Conversation): - All the three WS- define authentication, security, data integrity and privacy features for a service.

3.Reliability (WS-Reliable Messaging): - This specification ensures end-to-end communication when we want SOAP messages to be traversed back and forth many times.

4.Transactions (WS-Coordination and WS-Atomic Transaction): - These two specifications enable transaction with SOAP messages.

5.Metadata (WS-Policy and WS-Metadata exchange): - WSDL is a implementation of WS-Metadata Exchange protocol. WS-Policy defines more dynamic features of a service, which cannot be expressed by WSDL.
We have stressed on the WS-* specification as it is a specification which a service has to follow to be compatible with other languages. Because WCF follows WS-* specifications other languages like JAVA , C++ can also exploit features like Messaging , Security , Reliability and transactions written in C# or VB.NET. This is the biggest achievement of WCF to integrate the above features with other languages.