300+ TOP WCF Interview Questions and Answers

WCF Interview Questions and Answers for freshers experienced :-

1. What is WCF?
WCF stands for Windows Communication Foundation. It is a Software development kit for developing services on Windows. WCF is introduced in .NET 3.0. in the System.ServiceModel namespace. WCF is based on basic concepts of Service oriented architecture (SOA)

2. What is endpoint in WCF service?
The endpoint is an Interface which defines how a client will communicate with the service. It consists of three main points: Address,Binding and Contract.

3. Explain Address,Binding and contract for a WCF Service?
Address:Address defines where the service resides.

Binding:Binding defines how to communicate with the service.

Contract:Contract defines what is done by the service.

4. What are the various address format in WCF?
a)HTTP Address Format:–> http://localhost:

b)TCP Address Format:–> net.tcp://localhost:

c)MSMQ Address Format:–> net.msmq://localhost:

5. What are the types of binding available in WCF?
A binding is identified by the transport it supports and the encoding it uses. Transport may be HTTP,TCP etc and encoding may be text,binary etc.

The popular types of binding may be as below:





6. What are the types of contract available in WCF?
The main contracts are:

  • Service Contract: Describes what operations the client can perform.
  • Operation Contract : defines the method inside Interface of Service.
  • Data Contract: Defines what data types are passed
  • Message Contract: Defines wheather a service can interact directly with messages

7. What are the various ways of hosting a WCF Service?
a)IIS b)Self Hosting c)WAS (Windows Activation Service)

8. What is the proxy for WCF Service?
A proxy is a class by which a service client can Interact with the service.

By the use of proxy in the client application we are able to call the different methods exposed by the service

9. How can we create Proxy for the WCF Service?
We can create proxy using the tool svcutil.exe after creating the service.

We can use the following command at command line.

svcutil.exe *.wsdl *.xsd /language:C# /out:SampleProxy.cs /config:app.config

10.What is DataContract and ServiceContract?Explain
Data represented by creating DataContract which expose the data which will be transefered /consumend from the serive to its clients.

**Operations which is the functions provided by this service.

To write an operation on WCF,you have to write it as an interface,This interface contains the “Signature” of the methods tagged by ServiceContract attribute,and all methods signature will be impelemtned on this interface tagged with OperationContract attribute.and to implement these serivce contract you have to create a class which implement the interface and the actual implementation will be on that class.

Code Below show How to create a Service Contract:



Public Interface IEmpOperations



Decimal Get EmpSal(int EmpId);


Class MyEmp: IEmpOperations


Decimal Get EmpSal()


// Implementation of this method.



WCF Interview Questions
WCF Interview Questions

12. What is Windows card space?
Windows card space is a central part of Microsoft’s effort to create an identify met system, or a unified, secure and interoperable identify layer for the internet.

13. What are the main components of WCF?
There are three main components of WCF:

  1. Service class
  2. Hosting environment
  3. End point

14. What are the advantages of hosting WCF Services in IIS as compared to self hosting?
There are two main advantages of using IIS over self hosting.

  1. Automatic activation
  2. Process recycling

15. What is .NET 3.0?
In one simple equation .NET 3.0 = .NET 2.0 + Windows Communication Foundation + Windows Presentation Foundation + Windows Workflow Foundation + Windows Card Space.

16. What is the difference between WCF and Web Services?

Web services can only be invoked by HTTP. While Services or a WCF component can be invoked by any protocol and any transport type. Second web services are not flexible. However Services are flexible. If you make a new version of the service then you need to just expose a new end. Therefore services are agile and which is a very practical approach looking at the current business trends.

17. What are the different bindings supported by WCF?
WCF includes predefined bindings.

Basic Http binding

WsHttp binding

NetTcp Binding

Netnamed pipes binding

Net MSMQ binding

18. Can we have two way communications in MSMQ?

19. What are dead letter queues?
The main use of queue is that you do not need the client and the server running at one time. Therefore it is possible that a message will lie in queue for long time until the server or client picks it up. But there are scenarios where a message is no use after a certain time.

20. what are the various ways of hosting a WCF service?
There are three major ways to host a WCF service :

  • Self-hosting the service in his own application domain. This we have already covered in the first section. The service comes in to existence when you create the object of Service Host class and the service closes when you call the Close of the Service Host class.
  • Host in application domain or process provided by IIS Server.
  • Host in Application domain and process provided by WAS (Windows Activation Service) Server

21. What are the core security features that WCF addresses?

  • Confidentiality
  • Integrity
  • Authentication
  • Authorization

22. What is SOA?
SOA is a collection of well defined services, where each individual service can be modified independently of other services to help respond to the ever evolving market conditions of a business.

23. What is the difference between transport level and message level security?
Transport level security happens at the channel level. Transport level security is the easiest to implement as it happens at the communication level. WCF uses transport protocols like TCP, HTTP, MSMQ etc and every of these protocols have their own security mechanisms.

Message level security is implemented with message data itself.

24. What is service and client in perspective of data communication?
A service is a unit of functionality exposed to the world.

The client of a service is merely the party consuming the service.

25. What is bindings?
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.

26. What are the advantages of WCF?

  1. WCF is interoperable with other services when compared to .Net Remoting,where the client and service have to be .Net.
  2. WCF services provide better reliability and security in compared to ASMX web services.
  3. In WCF, there is no need to make much change in code for implementing the security model and changing the binding.
  4. WCF has integrated logging mechanism, changing the configuration file settings will provide this functionality.

27. Define service contracts?
Service contracts define the operations that a service will perform when executed. They tell the outside world a lot about the service such as message data types, operation locations, the protocols the client will need in order to communicate with the service, and the operations the service provides.

28. Define message contracts?
Message contracts allow the control of SOAP messages that are produced and consumed by WCF. Basically it boils down to being able to customize the format of contract parameters and the placing of elements within a SOAP message, or in other words, having control of the structure as well as the contents of a SOAP message.

29. Define data contracts?
Data contracts specifically define the data that is being exchanged between a client and service. The data contract is an agreement, meaning that the client and the service must agree on the data contract in order for the exchange of data to take place.

30. Define transaction?
A transaction is a collection or group of one or more units of operation executed as a whole. Another way to say it is that transactions provide a way to logically group single pieces of work and execute them as a single unit, or transaction.

31. What is address in WCF?
Address is a way of letting client know that where a service is located. In WCF, every service is associated with a unique address.

32. What are the types of bindings in WCF?

  • Basic binding
  • TCP binding
  • Peer network binding
  • IPC binding
  • Web Service (WS) binding
  • Federated WS binding
  • Duplex WS binding
  • MSMQ binding
  • MSMQ integration binding

33. What are different elements of WCF Srevices Client configuration file?
WCF Services client configuration file contains endpoint, address, binding and contract.

34. What are the features of WCF?

  • Transactions : A transaction is a unit of work. A transaction ensures that everything within that transaction either succeeds as a whole or fails as whole.
  • Hosting : WCF hosting allows services to be hosted in a handful of different environments, such as Windows NT Services, Windows Forms, and console applications, and well as IIS (Internet Information Services) and Windows Activation Services (WAS).
  • Security : WCF also enables you to integrate your application into an existing security infrastructure, including those that extend beyond the standard Windows-only environments by using secure SOAP messages.
  • Queuing : WCF enables queuing by providing support for the MSMQ transport.

35. Explain WCF contracts?
Contracts in Windows Communication Foundation provide the interoperability they need to communicate with the client. It is through contracts that clients and services agree as to the types of operations and structures they will use during the period that they are communicating back and forth. Without contracts, no work would be accomplished because no agreement would happen.

Three basic contracts are used to define a Windows Communication Foundation service :

  1. Service Contract : Defines the methods of a service, that is, what operations are available on the endpoint to the client.
  2. Data Contract : Defines the data types used by the available service methods.
  3. Message Contract : Provides the ability to control the message headers during the creation of a message.

36. What is the use of SessionMode?
The SessionMode attribute specifies the type of support for reliable sessions that a contract requires or supports. The value of this parameter comes from the Session Mode enumeration.

37. What are the types of messaging programs?
In WCF, different types of applications can send and receive messages.

  • Clients
  • Services
  • Intermediaries

38. What is transfer security?
Transfer Security is responsible for providing message integrity, confidentiality, and authentication Each of these were defined previously. Windows Communication Foundation builds on this security to include quite a few modes of transfer security.

39. What are the types of messaging patterns?
Messaging patterns basically describe how programs exchange messages. When a program sends a message, it must conform to one of several patterns in order for it to successfully communicate with the destination program.

There are three basic messaging patterns that programs can use to exchange messages.

  1. Simplex
  2. Duplex
  3. Request Reply

40. What is the difference between WCF Service and Web Service?
Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service.

The following point provides the detailed differences between them :

  1. Hosting : Webservices can be host in IIS, whereas WCF services can be hosted in IIS, Windows Activation Service, Self Hosting.
  2. Encoding : Webservices uses XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, Custom. WCF uses XML 1.0, MTOM, Binary, Custom.
  3. Transports : Webservices can be accessed using HTTP, TCP, Custom. WCF services can be accessed using HTTP, TCP, Named Pipes, MSMQ, P2P, Custom.
  4. Protocols : Webservices uses Security porotocols only. Whereas WCF services uses Security, Reliable Messaging, Transactions protocols.

WCF Questions and Answers Pdf Download

Leave a Reply

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