3

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?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
chobo2
  • 83,322
  • 195
  • 530
  • 832
  • possible duplicate of [What are the benfits of using WCF over ASMX web services?](http://stackoverflow.com/questions/1941481/what-are-the-benfits-of-using-wcf-over-asmx-web-services) – marc_s Jul 09 '10 at 18:06

3 Answers3

2

Some links:

plus this topic has been discussed to death here on Stackoverflow - there's got to be a ton of duplicates.....

and many many more....

Community
  • 1
  • 1
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
1

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
  • 242,243
  • 40
  • 408
  • 536
  • 1
    what do you mean that they've taken ASMX away? It's still supported, though considered to be a "legacy technology". – John Saunders Jul 09 '10 at 18:11
  • 1
    @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 Jul 09 '10 at 18:25
  • 1
    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 Jul 09 '10 at 19:30
  • @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 Jul 09 '10 at 19:47
1

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
  • 11,165
  • 9
  • 62
  • 113
  • 1
    If your problem involves Production-quality services, then you probably want Microsoft to fix bugs - that means you want to use WCF. – John Saunders Jul 09 '10 at 18:12
  • What do you mean by production-quality? – Achilles Jul 09 '10 at 18:16
  • 2
    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 Jul 09 '10 at 19:31