Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choice for WCF Service Hosting with IIS or Self Hosting with Windows Service

As we want to develop a new product using Asp.Net MVC 3. The key point here is everything we talk to database by WCF web service.

We are in the phase where we need to decide whether we host WCF web service in IIS OR self hosting with Windows Service.

I raised this question just because I want to know that, what would be the better option to host WCF service that would satisfy my below conditions.

  • We're expecting 120 concurrent request / second. (May be 12,000 request/visit per day)
  • Security aspect (Specially WCF Service security)
  • Maintainability
  • Handling user's concurrent request at the same time (Can Windows Service handle multiple concurrent request comparing to IIS?)

Please do let me know whether I go for IIS hosting OR self hosting with Windows service.

Thanks in advance.

(Could anybody please suggest on this as this is a very crucial part to have decision for further process.)

like image 722
nunu Avatar asked Mar 21 '12 08:03

nunu


People also ask

Which hosting mechanism is supported by WCF?

Hosting Mechanisms − Various activation mechanisms are there for WCF hosting, i.e., IIS (Internet Information Service), WAS (Windows Activation Service), Self-hosting and Windows Service, but a web service is hosted only by IIS.

Which are the different ways of configuring host for a WCF service?

There are three types of hosting environments for WCF services: IIS, WAS, and self-hosting. The term “self-hosting” refers to any application that provides its own code to initialize the hosting environment. This includes console, Windows Forms, WPF, and managed Windows services.

Can we host Windows service in IIS?

In short, you can't. A more detailed answer is that there are 2 problems: IIS worker processes are launched only when a HTTP request comes in. This means you can't start your service with the system.

What is WCF hosting?

This hosting option consists of registering the application domain (AppDomain) that hosts a WCF service as a managed Windows Service (formerly known as NT service) so that the process lifetime of the service is controlled by the service control manager (SCM) for Windows services.

Can I host a WCF service in IIS?

This hosting option requires that IIS be properly configured, but it does not require that any hosting code be written as part of the application. For more information about how to configure IIS hosting for a WCF service, see How to: Host a WCF Service in IIS. IIS-hosted services can only use the HTTP transport.

Which self-hosting environment is best for WCF services?

4.5. Hosting in a Windows Service - Learning WCF [Book] Windows services are the most useful of the self-hosting environments for WCF services. In fact, for services deployed in a production server system, the Windows service is the only practical self-hosting choice for a few reasons:

How do I host a WCF service in a managed application?

Self-Hosting in a Managed Application. WCF services can be hosted in any managed application. This is the most flexible option because it requires the least infrastructure to deploy. You embed the code for the service inside the managed application code and then create and open an instance of the ServiceHost to make the service available.


1 Answers

You might interest, This is the "general decision tree" from "Programming WCF Services", Juval Lowy.

Choosing a host for an Internet service: For an internet application (that is, an application that receives calls from clients across the Internet)

Choosing a host for an Internet service

Choosing a host for Intranet service: For an intranet application (that is, an application that receives calls from clients within the same intranet), Choosing a host for an Intranet service

like image 114
Min Min Avatar answered Oct 11 '22 11:10

Min Min