views:

273

answers:

5

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

Any pointers?

+2  A: 

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/

Ben Runchey
+6  A: 

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

RandomNoob
A: 

Here is an article from Keith Elder that I ran across awhile back that may help a little: http://www.keithelder.net/blog/archive/2008/10/17/WCF-vs-ASMX-WebServices.aspx

Have a great Christmas!

RTipton
A: 

ASMX web services are now considered by Microsoft to be "legacy technology". WCF should be used for all new web service development.

John Saunders
+2  A: 

Here is a useful comparison between ASMX and WCF: http://bishoylabib.blogspot.com/2009/08/comparing-asmx-and-wcf.html

Bishoy Labib