简体   繁体   English

WCF中添加服务引用和代理类之间的区别

[英]difference between adding service reference and proxy class in WCF

I am new to WCF and wondering if there any difference between Proxy class and adding a service reference in client application? 我是WCF的新手,想知道Proxy类和在客户端应用程序中添加服务引用之间是否有区别?

Thanks 谢谢

is not any difference in the level of use, they are two proxies. 使用水平没有任何区别,它们是两个代理。

Service reference : the advantage that gives you is, when you want to upgrade the service you can do directly from VS ("Update Service Reference), otherwise you'll have to do it manually. 服务参考 :给您带来的好处是,当您要升级服务时,可以直接从VS(“更新服务参考”)进行操作,否则必须手动进行。

you can find all infos in http://msdn.microsoft.com/en-us/library/bb628652.aspx 您可以在http://msdn.microsoft.com/zh-cn/library/bb628652.aspx中找到所有信息

Adding service reference or generating proxy classes through svcutil.exe are basically the same. 通过svcutil.exe添加服务引用或生成代理类基本相同。 The first one actually calls svcutil like API to generated proxy classes in the References folder. 第一个实际上调用svcutil之类的API来在References文件夹中生成代理类。

Using svcutil.exe you will get more fine grained control, which is good for big projects and long term maintenance, because command line options give you more flexibility than GUI of adding service reference. 使用svcutil.exe,您将获得更精细的控制,这对于大型项目和长期维护非常有用,因为命令行选项比添加服务引用的GUI更灵活。

And if you want to automate the generation of proxy classes and you develop both service and client, you may refer to this link at is there a way to automatically update proxy object when updating service on WCF? 并且,如果您想自动生成代理类并开发服务和客户端,则可以参考以下链接, 在WCF上更新服务时,有没有一种方法可以自动更新代理对象?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM