WCF, commonly known as (Windows Communication Foundation), previously known as “Indigo”, is a runtime and a set of APIs (application programming interface) in the .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. WCF provides a runtime environment for services, enabling you to expose CLR (Common Language Runtime) types as services, and to consume other services as CLR types.
WCF is part of .NET 3.0 and requires .NET 2.0, so it can only run on systems that support it.
Name the Contracts in WCF?
Ans: The Contracts in WCF are:
- Service Contracts.
- Operation Contracts.
- Data Contracts.
- 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.
State the address syntax and the different formats of WCF transport scheme.
Ans: Address syntax of WCF transport scheme:
[transport]://[machine or domain][:optional port] format.
The address formats are as follow:
HTTP Address Format TCP Address Format
IPC Address Format
MSMQ Address Format
Name the three major points in WCF?
Ans: Address, Binding and Contract.
Check Now- How to Crack Infosys Interview Questions
WCF Interview Questions for Fresher’s
Define ABC of WTF?
Ans: A – Address (Where): Hints us towards the direction of services, like URL (Uniform Resource Locator).
B – Bindings (How): This feature tells us how to find the services or using which protocols finds the services (SOAP, HTTP, TCT etc.)
C – Contracts (What): Contracts are an agreement between the consumer and the service providers that explains what parameters the service expects and what value it returns.
Name the 3 types of transaction manager WCF supports?
Ans: Following are the 3 types of transaction manager WCF supports:
- Light Weight
- WS- Atomic Transaction
- 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.
Check Now: Aptitude Questions and Answers
What is WCF- One Way Contract?
Ans: One Way Contract in WCF are methods/operations which are invoked on the service by the client or the server in which either of them do not expect a reply back.
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:
Trick WCF Interview Questions for the experienced
Define proxy for WCF Service?
Ans: A proxy is a class by which a service client can interact with the service. By the use of proxy in the client application one is able to call the different methods exposed by the service.
Mention 4 differences between XMLSerializer and the DataContractSerializer?
Ans: The points of differences are as follows:
- DataContractSerializer is the default serializer for WCF, XML Serializer is not.
- DataContractSerializer faster compared to XMLSerializer.
- DataContractSerializer is basically for very small, simple subset of the XML info-set.
- 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?
Ans: Following are the characteristics of WCF Data Contract:
– A data contract is defined by using a Data Contract Attribute on a class or structure.
– Members of the data structure which will be used by the service need to be marked with the Data Member Attribute.
– 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
Response, redirect (“1.aspx”);
Response, redirect (“2.aspx”);
Response, redirect (“3.aspx”);
Ans: The Output will redirect the page to 3.aspx.
Explanation- Try block will throw a redirect error but after execution of the catch box the control will pass to the finally block which will redirect the page to 3.aspx.
Share and Enjoy