Should I use a WCF or an ASMX webservice?
I was looking for an asp.net webservice that uses .net 4.0 but everytime I choose 4.0 the webservice choice goes away.
Someone suggested to me that maybe they(MS) want you to use WCF instead. I don't know m开发者_JAVA技巧uch about it but he said they are like webservices but better. So anyone got a comparisons guide?
Some links:
- WCF vs. ASMX web services
- Comparing WCF and ASMX
- ASMX or WCF services
plus this topic has been discussed to death here on Stackoverflow - there's got to be a ton of duplicates.....
- What are the benefits of using WCF over ASMX web services?
- What are the differences between WCF and ASMX web services?
- Benefits to switching from classic asmx to wcf
and many many more....
First off...FORGET what Microsoft WANTS you to use, you should use the technology that best solves your problem.
One advantage of WCF over ASMX is an improved and more robust security model. However if you can secure the service or it is public then that isn't a consideration. WCF can also be hosted within an application that runs on a remote server as opposed to ASMX which must be hosted through IIS.
Windows Communication Foundation (WCF) is a Framework for building services.
A Web Service is one kind of service you can build using WCF.
Therefore, you should build your Web Service using WCF.
With .NET 4.0, Microsoft has taken the classic ASMX style Web Services away and are pushing everybody to WCF. You can build Web Services that function the same way as your ASMX Web Services in WCF, it's just a matter of defining the correct binding.
精彩评论