WCF Interview Questions and Answers

WCF Interview Questions and Answers

Q1.What is WCF? Briefly explain.
Windows Communication Foundation is a Software development kit (SDK) to develop and deploy services in Windows. WCF provides a runtime environment for services. It enables Common Language Runtime (CLR) kinds of services to be exposed, while consuming other services as CLR types. WCF is a part of the .NET 3.0 framework and it requires .NET 2.0, and it can run only on systems that support it.
Q2.What are the main components of WCF?
We need to define three main components in WCF:-
  • Service class.
  • Hosting environment
  • End point  
Q3.Explain how does WCF works?
WCF follows the “Software as a Service” model, where all units of functionality are defined as services. For communication, each point is a portal or connection either with the client or other services. It is a program that exposes a collection of endpoints.
Q4.What are the protocols used in Message Layer in WCF ?
There are some functionality of protocols which are used in messaging layer in WCF.
Ws-Security Channel:- It enables .to secure the message by implementing the ws-security specification in the messaging layer of a service.
Ws-Reliable Messaging Channel:- This protocols gives guarantee to deliver the message over channels.
Encodes:- It provides the number of encodes for message.
HTTP Channel:- It specifies that HTTP is used for delivering a message.
TCP Channel:- It specifies that TCP is used for delivering the message.
Transaction flow Channel:- It define the pattern in which a message is transacted.
Named Pipe Channel:- It enables inter-process communication (IPC).
MSMQ Channel:- It enables services to inter-operate the MSMQ Applications.
Q5.What are different ways in which WCF can be hosted ?
The different hosting techniques are
1.IIS hosting–This is the most commonly used hosting technique.Here IIS is
used as a  server and has following
advantages -> starts automatically on the first client  request,process recyling.
Disadvantage– It supports only http protocol
2.Self hosting-This is hosting the WCF  urself either in console/windows
application also  in windows service .
The host process  should be running before a client makes a call to servc.
Its easier to debug and deploy.
Lifetime of services can be controlled using Open and Close methods.
WAS hosting(Windows Activation Server hosting)–WAS was introduced
with windows  vista and it is shipped with IIS 7.0. it is more powerful than
3.IIS 6.0 as it can support  http,tcp and named pipes whereas IIS 6.0 can
support only http.
4.Windows Service Hosting–Here the service can be programmed to start
when the system starts.
Q6.What is the difference WCF and Web services?
Web services can only be invoked by HTTP. While Service or a WCF component can be invoked by any protocol and any transport type. Second web services are not flexible. However, Services are flexible.

Comments

Popular posts from this blog

PHP Interview Questions and Answers for Freshers 2018

ASP.NET Interview Questions and Answers For Experienced