WCF Service Interview QA-2


  1. What are the main components in WCF?

    The main components of WCF are

    1. Service Class
    2. Hosting Environment
    3. Endpoint

  2. How many types of hosting supported by WCF?

    There are three type of hostings supported by WCF, that are

    1. IIS Hosting
    2. Self Hosting
    3. WAS Hosting

  3. What is IIS-Hosting in WCF?

    Click the link for more details about IIS hosting.

  4. What is Self-Hosting in WCF?

    Programmatically hosting WCF service is called self-hosting, this can be possible through managed code. In self-hosting developer can host using program like windows form, console application etc.

  5. What WAS Hosting in WCF?

    WCF Service can be hosted in Window Activation Service , developer will get more advertence by hosting WCF service in WAS because of its valuable features like idle time management, support for HTTP and TCP protocol, common configuration system and process recycling feature.

  6. What is WAS?

    Windows Server 2008 adds a new tool called the Windows Process Activation Service (WAS). This service replaces the WWW service in managing application pool configuration and worker processes. The functionality that existed with the WWW service that ran only HTTP sites now allows WAS to run non-HTTP sites in addition to the HTTP sites. WAS is not part of IIS 8.0, but rather an external service that works in conjunction with IIS to manage the application pools and processes.

  7. What is ServiceBefavior in WCF?

    It is an attribute used to specify the InstanceContextMode and ConcurrencyMode for WCF Service class.

  8. What is InstanceContextMode in WCF?

    The InstanceContextMode specifies how to maintain instance or state of WCF service for a client.

  9. How many types of InstanceContextMode and what are that?

    There are three types of InstanceContextMode available in WCF. that are

    1. PerSession
    2. PerCall
    3. Single

  10. What is PerSession InstanceContextMode

    In the PerSession InstanceContextMode, a new instance is created for a service and the same instance is used for all method for a single client.

  11. What is PerCall

    In this mode a new instance of service is created for each method call from client whether same or different client.

  12. What is Single InstanceContextMode?

    When the InstanceCntextMode is set as Single then only one instance of service is created for all client.

  13. What is ConcurrencyMode?

    WCF Concurrency modes gives us the possibility of taking control over the thread creation process so that a WCF service creator can take better, desirable and perhaps more control on the WCF service behavior.

  14. How many types of ConcurrencyMode there in WCF?

    There are three types of ConcurrencyMode, that are

    1. Single
    2. Multiple
    3. Reentrant

  15. What is Single ConcurrencyMode?

    This is the default mode and this mode is safest from the concurrency perspective as the developer will not have to take care of concurrency issues in the code.When the service is set to Single Concurrency Mode, each instance context(Single,PerCall,PerSession) is allowed to have a maximum of one thread processing messages at the same time.

  16. What is Multiple ConcurrencyMode

    When the service is set to Multiple Concurrency Mode,each service has multiple threads for processing messages concurrently. The service implementation must be thread-safe to use this concurrency mode.

  17. What is Reentrant ConcurrencyMode

    Reenatrant Concurrency Mode is quire similar to Single Concurrency Mode , you can say it is the modified version of Single Concurrenct Mode and allows only one thread to process the instance at a time.