开发者

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

What are the benefi开发者_运维知识库ts of using WCF over ASMX web services?

Any pointers?


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


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/


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜