Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Benefits to switching from classic asmx to wcf

Tags:

wcf

asmx

Recently I made the switch from using asmx web services to using wcf services, the transition is nearly finished, but I know I'm in for a lot of error checking and testing to make sure everything ported as expected.

My question is - so far I can only think of 1 good benefit to using wcf, and that is you get an easy way to implement a singleton web service.

Besides that I have to tell you, configuring a WCF Application seems way overly complicated, and I'll forever miss how easy it was to test asmx web services.

What other benefits are there to using WCF over ASMX web services?

like image 854
JL. Avatar asked Oct 05 '09 17:10

JL.


2 Answers

  • more protocol options; ASMX is IIS and HTTP only - WCF gives you HTTP, NetTcp, MSMQ, IPC - you name it
  • you can write your service once, and expose it on multiple endpoints
  • self-hosting: you can host your WCF service in a console app, a Winforms app, a WPF app, or let it be handled by IIS/WAS - but you don't have to
  • a lot more options like reliable sessions, lot more security options
  • you don't have to deal with as much "plumbing goo" in WCF as you do in ASMX - you can concentrate on your business problem, and let the config and attributes handle all the gooey stuff you don't want to deal with

to name just a few.....

Search Google or Bing for "WCF vs ASMX" and I'm sure you'll find plenty more article, blog posts and comparisons.

ASMX has passed its time - WCF is the present and the future. It can do a lot more - therefore it's a bit more to learn.

But if you check out the right sources, like these two Dotnet Rocks TV shows (Keith Elder Demystifies WCF and Miguel Castro on Extreme WCF), I'm sure you'll get a quick and hopefully painless start into WCF!

Marc

like image 172
marc_s Avatar answered Nov 10 '22 05:11

marc_s


WCF allows you detach service from the physical layout and protocols. For example, you can write one service and deploy it as either REST or SOAP, or whatever that may happen in the future. ASMX is great, but it's pretty much hardcoded to SOAP. Also the idea is that you can plug-in existing features like throttling just by changing preferences, which I haven't seen much benefit of.

like image 1
Eugene Yokota Avatar answered Nov 10 '22 04:11

Eugene Yokota