views:

88

answers:

3

Hi

I was looking for an asp.net webservice that uses .net 4.0 but everytime I choose 4.0 the webservice choice goes away.

Someone suggested to me that maybe they(MS) want you to use WCF instead. I don't know much about it but he said they are like webservices but better. So anyone got a comparisons guide?

+1  A: 

Windows Communication Foundation (WCF) is a Framework for building services.

A Web Service is one kind of service you can build using WCF.

Therefore, you should build your Web Service using WCF.

With .NET 4.0, Microsoft has taken the classic ASMX style Web Services away and are pushing everybody to WCF. You can build Web Services that function the same way as your ASMX Web Services in WCF, it's just a matter of defining the correct binding.

Justin Niessner
@Justin: what do you mean that they've taken ASMX away? It's still supported, though considered to be a "legacy technology".
John Saunders
@John - By "taken away", I mean that the project option isn't available when targeting .NET 4.0 (unless I missed something, in which case I'd be interested to know how to get the option back).
Justin Niessner
@Justin: I'm glad they're gone, as devs were probably creating such services inadvertently. Still, try creating one for 3.5, then changing the target version to 4.0.
John Saunders
@John - I agree. I wasn't aware that you could still target 4.0 with an ASMX web service (and have it work). I've seen reports of people trying and having the service fail.
Justin Niessner
A: 

First off...FORGET what Microsoft WANTS you to use, you should use the technology that best solves your problem.

One advantage of WCF over ASMX is an improved and more robust security model. However if you can secure the service or it is public then that isn't a consideration. WCF can also be hosted within an application that runs on a remote server as opposed to ASMX which must be hosted through IIS.

Achilles
@Achilles: If your problem involves Production-quality services, then you probably want Microsoft to fix bugs - that means you want to use WCF.
John Saunders
What do you mean by production-quality?
Achilles
@Achilles: production quality meaning someone's in big trouble if the application is down - maybe even gets fired. Could also mean the company loses serious money as long as the service is down. This is as opposed to a case where a service down is just an inconvenience.
John Saunders