views:

682

answers:

5

I have to create a Web Service that can service around 100,000 clients. I have been creating Windows Services for quite some time and use WCF binding in them. The Windows Services use HTTP binding and provide a http end point that can be used by any client that can talk using SOAP. I am a little confused whether I should create a ASP.NET Web Service or a Windows Service because both of them will provide a HTTP end point. I think before WCF came around, Web Services used to enjoy the HTTP bindings and the Windows Services were used with remoting etc.

If both provide same HTTP end point then what should be the criteria for deciding on the service type?

A: 

Given the scale of what you're doing, you might want to stick with WCF. The ease of configuring different protocols and other framework features such as built in logging should serve you well.

One advantage of using an asmx service is that it's easy to integrate into a web site project. If you're on a small scale site with shared hosting, you might not be able to run a WCF service, but you will be able to run an asmx service.

Paul Keister
When I used to create asmx services, they were like Web projects and the WCF services I create are Windows Services. Will it make any diff if I create a service hosted on IIS or create a Windows Service?Or am I confusing myself?
A9S6
I would absolutely recommend using IIS as suggested by sipwiz, jp, and Gidon rather than a Windows service.The word "hosted" has different meanings; when I said, "shared hosting" I was referring to a 3rd party hosting service. This is just a general point that asmx is supported more broadly.
Paul Keister
A: 

You should definitively think about scalability here. For example: what happens if your system has to be scaled up using a Web farm? How does the Win service scenario fit into that situation?

Igor Brejc
+2  A: 

If you're building a high volume application that needs to service 100k clients then you should choose IIS. IIS has a lot of facilities built in to handle high loads along with enterprise features like authentication and SSL certificates. If you use a Windows Service you'll hvae to roll a lot of that yourself.

You can use WCF with either so it's a decision about which application type suits you better and it definitely sounds like IIS.

sipwiz
OK ! In VS2008, I can see "ASP.NET Web Service Application" and "WCF Service Application" under Web. And under WCF there is a WCF Service Library which is confusing me. I think the one that I need is "ASP.NET Web Service Application" project...
A9S6
Gidon posted the answer. You want an ASP.Net application and then another WCF library project which you will use from the ASP app.
sipwiz
+2  A: 

The endpoint where your services lives and WCF versus ASP.NET services are two different things. Here is a decent article on the differences between WCF & ASP.NET services. Where your endpoint is hosted is going to be important for you since you are looking for high scalability. You should leverage all the great stuff built into IIS7 in terms of scalability and reliability to host your endpoint. I don't see a good reason to host it in your own process. It will be a lot of work to develop something that can scale horizontally as easily as IIS7. Here is a small article on how to host a WCF service in IIS.

JP Alioto
+1 although the first article could be left out. Since it is confusing a bit. It shows ASP.NET Web Service versus WCF... It would be better to show an article showing the difference between IIS based WCF and Windows Service based WCF.
Gidon
+2  A: 

You should combine all the answers.

WCF services can be hosted as both a Windows Service, as well as in IIS. IIS provides you with much more tools to scale and handle large number of requests. Since you are targeting the web, and have IIS available go and use IIS.

JP's answer contains a link on how to host WCF in IIS, that should clear up the question you had in sipwiz's answer.

So go on and create a ASP.NET web app. And in there create a WCF service (or add a WCF service library project to your solution, and reference that in your ASP.NET web app.

Gidon