WCF代理和Windows应用程序 [英] WCF proxy and windows application

查看:82
本文介绍了WCF代理和Windows应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有一个.Net Windows应用程序.我已使用VS 2008的添加服务引用"选项为该应用程序添加了Wcf引用.
我在WCF中更新了一个方法(签名相同),并修改了托管地址.
现在,我已将我的窗口应用程序配置文件更改为指向正确的主机地址,但它仍旧使用旧的WCF.
当我开始进行挖掘时,我发现,当我最初使用VS 2008的添加服务引用"选项添加WCF引用时,它会创建许多文件(代理类),并且这些文件指向旧的WCF地址. br/> 我不想使用VS 2008的更新服务引用"选项来更新Windows应用程序中的服务引用,就像这样做一样,我不需要再次将可执行文件分发给所有用户.

任何帮助将不胜感激.

Hi All,
I have an .Net windows application. I have added an Wcf reference to this application using "Add Service Reference" option of VS 2008.
I have updated an method in the WCF(signature is same) and modified the hosting address.
Now, I have changed my window app config file to point to right host address but it is still hitting the old WCF.
When I start digging it out, I found that, when I added the WCF reference initially using "Add Service Reference" option of VS 2008, It creates lots of files(Proxy classes) and those files are pointing to the old WCF address.
I do not want to update the service reference in my windows application using "update Service Reference" option of VS 2008 as if I do so than I need to distribute the exeutable again to all the users.

Any help would be appreciated.

推荐答案

使用采用Endpoint参数的client/proxy类构造函数.您可以创建一个Endpoint对象,以指定正确的服务地址,该地址可以进行硬编码或从配置中获取.
Use the client/proxy class constructor that takes an Endpoint parameter. You can create an Endpoint object specifying the correct service address, which can be hard-coded or obtained from configuration.


这篇关于WCF代理和Windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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