Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the benefits of using WCF over ASMX web services?

What are the benefits of using WCF over ASMX web services?

Any pointers?

like image 442
Simon Train Avatar asked Dec 21 '09 17:12

Simon Train


2 Answers

What makes WCF powerful is its ability to expose services via multiple addresses, bindings and contracts. In WCF, you're programming at the interface level as opposed to the actual operation. If you think about it, this is extremely subtle, yet enormously powerful. With ASMX style services you're restricted to an http endpoint hosted by IIS, where as with WCF you can expose a single contract and implement and host it in a variety of ways. For example, if you wrote a calculator asmx service that returned the sum of two numbers, it would forever live on IIS and invoked from there. The same service operation, i.e. Add(int a, int b) via WCF could not only be altered in its implementation per channel, but could be hosted in many different ways outside of IIS. Also in ASMX if you're looking to implement any of the WS* Standards, you would have to use WSE etc, WCF wonderfully handles all this lower level plumbing for you, which you can implement via configuration or code, think Secure Conversation, Transactions, etc etc. There are lot of resources on WCF, you can look here for a good starting point

like image 121
Ta01 Avatar answered Sep 21 '22 00:09

Ta01


While I did not put this site together, the microsoft site "Champ vs. Contender" provides lots of resources for showing why they feel WCF is the better choice vs. ASMX.

http://www.microsoft.com/net/wcf/champ/

like image 25
brunch Avatar answered Sep 21 '22 00:09

brunch