网络参考和服务参考有什么区别?

发布于 2024-07-18 13:22:39 字数 22 浏览 1 评论 0原文

网络参考和服务参考有什么区别?

What is the difference between a web reference and a service reference?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

红颜悴 2024-07-25 13:22:40

一种引用settings.cs 文件[该文件不会自动从app.config 刷新,除非您打开它并重新保存它 - 如果您对app.config 进行编辑],另一种引用app.config 文件。 app.config 文件中的配置块略有不同,并且服务的幕后结构也略有不同。 您的代码与对象的交互会略有不同,但最终结果是它们本质上做相同的事情。 Web 引用基于 2.0,服务引用来自 .NET 3.0 或 3.5 [我不确定是哪一个]。

您仍然可以为 Web 引用编写代码,但如果您的应用程序面向 2.0 框架,则无法使用服务引用。

One references the settings.cs file [which isn't automatically refreshed from the app.config unless you open it and resave it - if you make edits to the app.config that is] and one references the app.config file. The configuration block in the app.config file is slightly different and the structure of the service is slightly different behind the scenes. Your code will interact with the objects slightly differently, but the end result is that they essentially do the same thing. Web References are 2.0 based and the service reference came about in .NET 3.0 or 3.5 [I'm not sure which].

You can still write code for web references, but if your application targets the 2.0 framework, you can't use service references.

浅唱々樱花落 2024-07-25 13:22:39

网络参考

是 wsdl.exe 的包装器,可用于为 .NET 1.1 或 2.0 客户端创建代理。 当然,这意味着当您指向 WCF 服务时,您必须指向使用 basicHttpBinding 的端点。

服务参考

是 svcutil.exe 的包装器,还创建客户端代理。 但是,这些代理只能由 .NET 3.0+ 客户端使用。

请参阅:“Web 参考”和“服务参考”之间的区别了解更多详细信息

Web Reference

is a wrapper over wsdl.exe and can be used to create proxies for .NET 1.1 or 2.0 clients. Of course this means when you are pointing to a WCF service you have to be pointing to an endpoint that uses basicHttpBinding.

Service Reference

is a wrapper over svcutil.exe and also creates clients proxies. These proxies, however, can only be consumed by .NET 3.0+ clients.

Refer to : The Difference Between “Web Reference” and “Service Reference” for more detail

逐鹿 2024-07-25 13:22:39

如果你指的是微软提供服务的功能。 Web 参考是一种较旧的提供服务的方式。
请参阅此链接:http://blogs.msdn.com/lienglu/archive/2007/06/20/add-an-old-8-0-style-web- Reference-into-an-orcas-vs-9-project.aspx

基本上它的想法是一样的,通过网络提供服务,但是 WCF 为您的应用程序提供了更多选择。

If you mean the feature from Microsoft of providing services. Web reference is an older way of providing service.
See this link : http://blogs.msdn.com/lifenglu/archive/2007/06/20/add-an-old-8-0-style-web-reference-into-an-orcas-vs-9-project.aspx

Basically it does the same think, providing services over web, but WCF gives you alot more options for your application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文