- What are the main components in WCF?
The main components of WCF are
- Service Class
- Hosting Environment
- Endpoint
- How many types of hosting supported by WCF?
There are three type of hostings supported by WCF, that are
- IIS Hosting
- Self Hosting
- WAS Hosting
- What is IIS-Hosting in WCF?
Click the link for more details about IIS hosting.
- 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.
- 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.
- 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.
- What is ServiceBefavior in WCF?
It is an attribute used to specify the InstanceContextMode and ConcurrencyMode for WCF Service class.
- What is InstanceContextMode in WCF?
The InstanceContextMode specifies how to maintain instance or state of WCF service for a client.
- How many types of InstanceContextMode and what are that?
There are three types of InstanceContextMode available in WCF. that are
- PerSession
- PerCall
- Single
- 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.
- What is PerCall
In this mode a new instance of service is created for each method call from client whether same or different client.
- What is Single InstanceContextMode?
When the InstanceCntextMode is set as Single then only one instance of service is created for all client.
- 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.
- How many types of ConcurrencyMode there in WCF?
There are three types of ConcurrencyMode, that are
- Single
- Multiple
- Reentrant
- 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.
- 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.
- 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.
Tags
wcf