【发布时间】:2010-08-19 13:43:32
【问题描述】:
有没有办法以编程方式更改 Web 服务的 <endpoint address="..." /> 值?在我的 app.config 文件中,我有以下代码:
<system.serviceModel>
<bindings>
...
</bindings>
<client>
<endpoint address="http://dev.remotedomain.com/WebServices/WebService.asmx"
binding="basicHttpBinding" bindingConfiguration="InboxServiceSoap"
contract="InboxServiceSoap"
name="InboxServiceSoap" />
</client>
</system.serviceModel>
我希望能够改变
address="http://dev.remotedomain.com/WebServices/WebService.asmx"
到
address="http://mymachine/WebServices/WebService.asmx"
在代码中。这在 .NET 中是否可能以编程方式实现?
【问题讨论】:
标签: .net web-services configuration console-application