Benefits to switching from classic asmx to wcf

前端 未结 2 1331
猫巷女王i
猫巷女王i 2021-02-09 22:48

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 m

相关标签:
2条回答
  • 2021-02-09 23:31

    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 讨论(0)
  • 2021-02-09 23:41
    • 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

    0 讨论(0)
提交回复
热议问题