WCF Interview Questions and Answers
Question - 81 : - What is Instance Management in WCF?
Answer - 81 : -
WCF manages the session by creating the instance of the service class. This created instance(s) to handle the incoming service request. In WCF, the session is the way of managing the services instance(s) so that the server can use these instances in an optimized way. At the server-side, the InstanceContext class is used to manage service class instances. There are following instance management ways :
- Per Call
- Per Session
- Single
Question - 82 : - What is Concurrency Management in WCF?
Answer - 82 : - Concurrency management is closely related to the Instance management in WCF but both are two different things. Instance management specifies how the service instances are created while Concurrency management specifies how many concurrent requests are handled by the service instances. By using concurrency, you can make your service instance thread-safe. By default, a per-call service instance is thread-safe since each request is served by a new service instance. A per-session service instance is not thread-safe since multiple requests of a client are served by a single service instance. Hence, it’s required concurrency management. A single service instance is not thread-safe since multiple requests of all clients are served by a single service instance. Hence, it’s required concurrency management.
Question - 83 : - What is service versioning?
Answer - 83 : - After the initial deployment of the WCF service, you may need to change the service for a variety of reasons like as changing business needs or fixing others issues. Each change in your existing service introduces a new version of the service. Service versioning is helpful in backward compatibility with your existing clients.
Question - 84 : - What is WCF Data Service?
Answer - 84 : - WCF Data Services uses OData (Open Data Protocol) protocol for querying or manipulating the data. WCF Data Services is built on top of WCF REST Services. It is a RESTful service to support CRUD operations on the database using the HTTP protocol. It supports all database operations using URI. DATA protocol can expose data from the relational database, File systems, Web sites, services etc. It supports XML or JSON format for exposing the data.
Question - 85 : - What is SOA?
Answer - 85 : - SOA stands for Service Oriented Architecture. It is an architectural design pattern which states that every component of a system should be a service (here service means a unit of a program that serves a business process), and the system should be composed of several loosely-coupled services means services should be independent of each other, so that changing one of them should not affect any other services.
Question - 86 : - What is serialization with respect to WCF?
Answer - 86 : -
With respect to WCF, Serialization is the process of converting an object into an XML representation. The reverse process that is reconstructing the same object from the XML is called Deserialization.
Question - 87 : - What is Web Services Policy?
Answer - 87 : -
Web Services Policy or WS-Policy is an interoperable standard for describing policies that influence communication with the clients. Usually, WS-Policy is included in the WSDL contract exposed by the WCF service, although it is optional.
Question - 88 : - What are SOAP Faults in WCF?
Answer - 88 : -
This is one of the frequently asked WCF Interview Questions and Answers. Common language runtime (CLR) exceptions do not flow across service boundaries. At the maximum, a CLR exception may propagate up to the service tier from business components. Unhandled CLR exceptions reach the service channel and are serialized as SOAP faults before reporting to clients. An unhandled CLR exception will fault the service channel, taking any existing sessions with it. That is why it is very important to convert the CLR exceptions into SOAP faults. Where possible, throw fault exceptions
SOAP faults are standards-based and interoperable. There are 2 formats used by SOAP faults, SOAP 1.1 and SOAP 1.2. SOAP format depends on the binding used.
Question - 89 : - What are bindings in WCF?
Answer - 89 : -
Bindings in WCF define the configuration of the communication channels between clients and services. Binding specifies
- Transport Protocol
- Message encoding
- Security Mechanism
- Reliable Messaging
- Transactions Support
Question - 90 : - What are different Transport protocols available in WCF?
Answer - 90 : -