如何编写 ac# 示例以读取我的客户端端点配置:
<client>
<endpoint address="http://mycoolserver/FinancialService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IFinancialService"
contract="IFinancialService" name="WSHttpBinding_IFinancialService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="http://mycoolserver/HumanResourcesService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHumanResourceService"
contract="IHumanResourceService" name="WSHttpBinding_IHumanResourceService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
目标是获取端点地址数组:
List<string> addresses = GetMyCurrentEndpoints();
结果我们会有:
[0] http://mycoolserver/FinancialService.svc
[1] http://mycoolserver/HumanResourcesService.svc