Visual Studio中/ SOAP - “添加服务引用”VS“添加Web服务引用” [英] Visual Studio/SOAP - 'Add Service Reference' vs 'Add Web Service Reference'

查看:1040
本文介绍了Visual Studio中/ SOAP - “添加服务引用”VS“添加Web服务引用”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现我可以导入我计划使用到我的解决方案的SOAP / WSDL服务无论是作为一个Web服务引用(System.Web.Services),或作为服务引用(System.ServiceModel / WCF)。

I've found that I can import a SOAP/WSDL service that I plan on using into my solution either as a "Web Service Reference" (System.Web.Services) or as a "Service Reference" (System.ServiceModel / WCF).

我如果有什么差异有疑惑。据我所知,添加服务引用/ WCF是新的,有什么缺点,使用它在System.Web.Services还是现在在.net中使用SOAP服务的preferred方式?

I was wondering if what the differences were. I understand that 'Add Service Reference'/WCF is newer, are there any disadvantages to using it over System.Web.Services or is it now the preferred way of consuming SOAP services in .Net?

推荐答案

在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

这篇关于Visual Studio中/ SOAP - “添加服务引用”VS“添加Web服务引用”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆