WCF Interview Questions and Answers

    1 Votes

16) Explain “Per Call” instance mode in WCF?

In “Per Call” mode, When a request has made to service, new instance of service will be created for each method call and this will be disposed once the response goes to client.

17) Explain “Per Session” instance mode in WCF?

Per Session” creates a logical session between service and client and it will be maintained till the session the ends. When client requests from service the session will be created and it is dedicated to instance for that client and it will going to end when client session ends.

18) Explain “Singleton” instance mode in WCF?

In “Singleton” mode all the clients are connected to the single instance of the service and when service configured for “Singleton” mode, instance will be created when service is hosted and it will be disposed once its shuts down.

19) What is Throttling in WCF?

Throttling” is used to limit the sessions or instances to be created at application level. And this will increase the performance.

20) What is the significance of “maxConcurrentCalls” in Throttling?

This attribute in throttling is used to limit the total number of calls which are going to the service instances. The default value is 16.

21) What is Service Proxy in WCF?

WCF Proxies are used to enable the communication between client and server by exchanging the messages in the form of requests and responses. It will have the details like Service Path, Protocol details and so on.

22) Explain Service Oriented Architecture?

Service Oriented Architecture is known as SOA. It is a design pattern where business functionality will be as a service and client will communicate to the service using proxy. Advantage of this will be – It is independent of platforms, vendor and product.

23) Why to use DataContarcts in WCF?

In WCF we can communicate with server from our client through message. So messages will be going to and fro between server and client. For security purpose we are serializing the messages sent across the wire.

[DataContact]” attribute given at class level to serialize the class by using “[Datamember]” attribute over properties.

24) Mention types of transaction managers in WCF?

Below are the types of transaction managers –

  • WS- Atomic Transaction
  • Light Weight
  • OLE Transaction

25) Explain DataContractSerializer ?

DataContractSerializer is introduced in .NET 3.0 and WCF uses DataContractSerializer as default one. But now this serializer can be used for other serialization purposes also. For serialization “WriteObject()” method is used.

Eg: DataContractSerializer dataContractSerializer = new DataContractSerializer(typeof(MyTestClassType));

26) Explain XMLSerializer ?

This serializer was there from the beginning of .NET version. To serialize or deserialize an object just create an instance of XmlSerializer and pass the type of object. Methods – “Serialize()” or “DeSerialize()” methods used to serialize and deserialize objects respectively.

Eg: System.Xml.Serialization.XmlSerializer xmlSerializer = new System.Xml.Serialization.XmlSerializer(typeof(MyTestClassType));

27) What are Operation Contracts in WCF?

Operation Contracts are the contracts between client and server on operations or methods which the service provides to the client. The methods used by the service are to be decorated by “[OperationContract]” attribute.

28) What are different modes of communication in WCF?

Below are the list of modes of communication between server and client –

  • One-Way
  • Request-Reply
  • Callback

29) Explain “Request-Reply” mode in WCF?

By default WCF works in this mode. When client made a request to a service, client will wait till it gets the response back to the client. If the response is not received till the given time, timeout error thrown. If client gets the response then next instructions will be executed.

30) What is the significance of “receiveTimeout” property in WCF?

This property is used to get/set the time interval that a connection remains active.

Page 2 of 4

Popular Videos


How to improve your Interview, Salary Negotiation, Communication & Presentation Skills.

Got a tip or Question?
Let us know

Related Articles

C# Interview Questions
.Net Framework Interview Questions and Answers
ADO.Net Interview Questions and Answers for Freshers, Experienced
ASP.Net Interview Questions and Answers
ASP.Net MVC Interview questions and Answers
ASP.Net Web API Interview Questions
Top 50 Entity framework interview questions & answers