【发布时间】:2017-08-07 11:36:48
【问题描述】:
我在安装我的一个项目时遇到了问题。它由三部分组成,一个客户端 WindowsForms-应用程序、一个 WCF-Webservice 和一个数据库(SQLExpress atm)。
目前,客户端和 Webservice 之间连接所需的端点地址和服务引用被硬编码到 WindowsForms-Project 的 app.config 中,引用运行 Webservice 的同一网络中的特定计算机,例如这个:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IWemosService" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://ent-ga-04:8733/Design_Time_Addresses/WcfServiceWemos/WemosService/"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWemosService"
contract="ServiceReferenceWemos.IWemosService" name="BasicHttpBinding_IWemosService" />
</client>
</system.serviceModel>
</configuration>
但是,在不同设备上安装客户端和 Web 服务之后,我必须更改这些值,当然,以匹配新设备和连接。我只是不知道该怎么做。你能帮帮我吗?
【问题讨论】:
标签: c# wcf webservice-client service-reference wcf-endpoint