11 11

Wcf interview questions and answers for 3 years experience

wcf interview questions and answers for 3 years experience


A binding defines how an endpoint communicates to the world. A binding defines the transport (such as HTTP or TCP) and the encoding being used (such as text or binary). A binding can contain binding elements that specify details like the security mechanisms used to secure messages, or the message pattern used by an endpoint.

WCF supports nine types of bindings.

Basic binding

Offered by the BasicHttpBinding class, this is designed to expose a WCF service as a legacy ASMX web service, so that old clients can work with new services. When used by the client, this binding enables new WCF clients to work with old ASMX services.

TCP binding

Offered by the NetTcpBinding class, this uses TCP for cross-machine communication on the intranet. It supports a variety of features, including reliability, transactions, and security, and is optimized for WCF-to-WCF communication. As a result, it requires both the client and the service to use WCF.


Peer network binding

Offered by the NetPeerTcpBinding class, this uses peer networking as a transport. The peer network-enabled client and services all subscribe to the same grid and broadcast messages to it.

IPC binding

Offered by the NetNamedPipeBinding class, this uses named pipes as a transport for same-machine communication. It is the most secure binding since it cannot accept calls from outside the machine and it supports a variety of features similar to the TCP binding.

Web Service (WS) binding

Offered by the WSHttpBinding class, this uses HTTP or HTTPS for transport, and is designed to offer a variety of features such as reliability, transactions, and security over the Internet.

Federated WS binding

Offered by the WSFederationHttpBinding class, this is a specialization of the WS binding, offering support for federated security.

Duplex WS binding

Offered by the WSDualHttpBinding class, this is similar to the WS binding except it also supports bidirectional communication from the service to the client.

MSMQ binding

Offered by the NetMsmqBinding class, this uses MSMQ for transport and is designed to offer support for disconnected queued calls.


MSMQ integration binding

Offered by the MsmqIntegrationBinding class, this converts WCF messages to and from MSMQ messages, and is designed to interoperate with legacy MSMQ clients.

For WCF binding comparison, see http://www.pluralsight.com/community/blogs/aaron/archive/2007/03/22/46560.aspx

NET Framework for building connected, service-oriented applications. Given below are some of the very important WCF Interview Questions (both conceptual and textual) essential for desired result in any interview.

The most common WCF Interview Questions

Briefly explain what is WCF?

Ans: Windows Communication Foundation (WCF) is an SDK (Software development kit) for developing and deploying services on Windows.

Name the Contracts in WCF?

Ans: The Contracts in WCF are:

  1. Service Contracts.
  2. Operation Contracts.
  3. Data Contracts.
  4. Fault Contracts.

Check Now: TCS Interview Question and Answers

What is endpoint in WCF?

Ans: It describes the actual behavior or operation of the service at runtime. It is the relationship between Address, contract and Binding.

Ans: Following are the 3 types of transaction manager WCF supports:

  1. Light Weight
  2. WS- Atomic Transaction
  3. OLE Transaction

What are Duplex Contracts in WCF?

Ans: WCF Services can communicate with client through a called duplex messaging pattern commonly known as callback. Duplex messaging in WCF can be done over different transports, like TCP, Named Pipes and even HTTP. This is collectively known as Duplex Contracts in WCF.

Ex: If a client invokes a method on the service then it will not expect a reply back from the service.

What is InstanceContextMode in WCF?

This particular property value in WCF indicates creation of new service objects. Following are the 3 property values of InstanceContextMode:

1. Per Call:

2. Per Session:

3. Single:

Trick WCF Interview Questions for the experienced

Define proxy for WCF Service?

Ans: The points of differences are as follows:

  1. DataContractSerializer is the default serializer for WCF, XML Serializer is not.
  2. DataContractSerializer faster compared to XMLSerializer.
  3. DataContractSerializer is basically for very small, simple subset of the XML info-set.
  4. XMLSerializer is used for complex schemes whereas DataContractSerializer are used for comparatively simple schemes.

Check Now: Basic Java Interview Questions and Answers

What are the characteristics of WCF Data Contract?

– Implementation of the same interface by different classes is made possible as only the selected members will be transferred between the service and the client.

Decode the following code

Try

{

Response, redirect (“1.aspx”);

}

Catch

{

Response, redirect (“2.aspx”);

}

Finally

{

Response, redirect (“3.

WCF helps in building applications to communicate with each other...

Components of WCF - WCF Service is composed of three components..

WCF has a variety of distributed programming infrastructures. WCF offers more flexibility and portability....

WCF allows duplex messaging pattern. Services can communicate with client through a callback....

.NET WCF - Different bindings: Built- in bindings and custom bindings...

Message queue allows applications running at different times to send and read messages from queues....

WCF also uses non transactional queues for storing messages. Such queues are volatile in nature.....

Ways of hosting WCF Service: Self hosting, Managed Windows services, Internet Information Services, Windows process activation service.....

Transactions in WCF allow several components to concurrently participate in an operation...

Programming approaches for WCF - Imperative, Configuration based, Attributes....

Advantages of hosting WCF services in IIS - Provides process activation and recycling ability thereby increasing reliability......

The different isolation levels: READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE....

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>