开发者

Benefits to switching from classic asmx to wcf

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 t开发者_StackOverflow中文版ell 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?


  • 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜