Web服务和WCF之间的区别

编程入门 行业动态 更新时间:2024-10-26 17:26:22
本文介绍了Web服务和WCF之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我对此有一点怀疑.在学习WCF与Web Service时遇到了以下问题,但无法理解如何实际完成. (1)Web服务不灵活. WCF服务具有灵活性.如果您制作了新版本的服务,则只需公开一个新的结局.因此,服务是敏捷的,这是一种针对当前业务趋势的非常实用的方法. 这意味着不能将Web服务更新到新版本(客户端可以更新Web服务吗?) 任何人都可以用一个实际的例子来解释这个问题吗?

Hi, I have a small doubt on below point. I come across the below point while while learning WCF Vs Web Service, but am not able to understand how this can be done practically. (1)Web services are not flexible. Where as WCF services are flexible. If you make a new version of the Service then you need to just expose a new end. Therefore, service are agile and which is a very practical approach looking at the current business trends. This means Web service can''t be updated to newer version(Client can update the webservice right?) Can anybody explain this with a practical example...

推荐答案

用最简单的术语讲,WCF可以做Web服务可以做的一切,WCF可以做更多的事. Web服务易于开发,但是只能执行一组有限的数据传输和方法. WCF具有广泛的Web标准和特定于.NET的传输,可以结合使用.这是一篇可以帮助您的文章: WCF和Web服务之间有什么区别? [ ^ ] 即使Web Services易于执行,除非您习惯将自己锁定为一种处理方式,否则请使用WCF.您仍然可以执行Web服务将为您完成的工作,但是现在您可以为将来变得更加灵活.例如,我最近在工作时创建了WCF服务.现在,我们所有的客户端都使用HTTPS连接到它进行测试.但是,一旦我们将其实时部署,我们将使用命名管道,因为它要快得多(WCF和前端将在同一服务器上).但是,在将来,我正计划为我们向移动客户端直接提供WCF服务的访问权限.这将意味着添加HTTPS访问.为此,只需要我们将信息添加到配置文件即可.五分钟的更改将使我们能够为不同的客户提供不同的访问权限. In simplest terms, WCF can do everything Web Services can do and WCF can do even more. Web services are easy to develop, but the only do a limited set of data transports and methods. WCF has a wide range of web standard and .NET-specific transports that can be used in combination. Here is an article that will help you out: What''s the Difference between WCF and Web Services?[^] Even though Web Services are easier to do, unless you are comfortable locking yourself into one way of doing things, go with WCF. You can still do what the Web Services would have done for you but now you can be more flexible for the future. For example, I recently created a WCF service at work. Right now, all of our clients are using HTTPS to connect to it for testing. However, once we deploy it live, we will use Named Pipes since it is much faster (WCF and the front-end will be on the same server). However, down the road I am planning for us to provide access to the WCF service to mobile clients directly. This would mean adding HTTPS access. To do so, it will simply require us to add info to the config file. A five-minute change will allow us to provide different access to different clients.

更多推荐

Web服务和WCF之间的区别

本文发布于:2023-10-07 17:44:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1470070.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:区别   Web   WCF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!