且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Studio中/ SOAP - “添加服务引用”VS“添加Web服务引用”

更新时间:2023-01-04 09:33:18

在preferred和最有效的方法确实使用添加服务引用。这将增加你的服务为WCF客户端代理。

The preferred and most useful way is indeed to use Add Service Reference. This will add your service as WCF client side proxy.

添加Web引用是旧式的做事ASMX / ASP.NET Web服务的方式。

Add Web Reference is the "old-style" ASMX/ASP.NET webservice way of doing things.

WCF是比ASMX更好的选择,因为:

WCF is the much better choice than ASMX, because:

  • 在它的更新,将在未来得到支持(ASMX是出路);如果你现在了解它,你就不必在以后学习它的时候ASMX肯定是走了
  • 在它提供了更多的灵活性,在每一个环节
  • 您永远只能举办一个ASMX服务是IIS,使用HTTP作为您的协议; WCF可以在IIS中承载;自托管的Windows NT服务; WCF可以使用HTTP,NetTCP,MSMQ和多协议
  • WCF提供了更多的安全和其他设置,使得它更强大的使用

是的,WCF有关于是真的很难去学习一个坏名声 - 我真的不觉得这是正确的。看看那些初学者的资源 - 确实是非常有用的。

Yes, WCF has a bad rap about being really hard to learn - I don't really find that to be true. Check out those beginner's resources - very useful indeed!

  • MSDN WCF Developer Center which has everything from beginner's tutorials to articles and sample code
  • Endpoint.TV screen cast series by Aaron Skonnard on WCF (at Channel9) - it's an excellent series going from "Creating your first WCF service" and "Creating your first WCF client" all the way to rather advanced topics. Aaron Skonnard very nicely explains everything in 10-15 minutes screencasts - highly recommended!
  • DotNet Rocks TV Show #122: Miguel Castro on Extreme WCF
  • DotNet Rocks TV Show #135: Keith Elder Demystifies WCF