wcf - 如何以编程方式设置 WCF 端点标识配置?

标签 wcf c#-4.0

如何像下面的其他配置一样以编程方式设置 dns?

  <endpoint address="https://admin.icafems.com/Services/EasyStartTrackingService.svc"
      binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IEasyStartTrackingService"
      contract="ES_Service.IEasyStartTrackingService" name="WSHttpBinding_IEasyStartTrackingService">
    <identity>
      <dns value="admin.icafems.com" />
    </identity>
  </endpoint>

    ServiceClient.Endpoint.Address = new EndpointAddress(ServiceURL);            
    ServiceClient.Endpoint.Binding = binding;
    ServiceClient.Endpoint.Name = "BasicHttpBinding_ILearningSuiteService";  

最佳答案

您将 EndpointIdentity 传递给 EndpointAddress 的构造函数

http://msdn.microsoft.com/en-us/library/bb628618.aspx

关于wcf - 如何以编程方式设置 WCF 端点标识配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6376864/

相关文章:

linq - Silverlight 的 LINQ-to-SQL 相当于什么?

c# - 如何使用 EntityFramework Reverse POCO Generator 生成导航属性?

asp.net-mvc - mvc4 区域内的路由操作无法映射操作

c# - 网络服务包装器

wcf - 在 web.config 中配置 wcf Rest 服务

c# - 需要 WCF MessageBodyMember

c# - 尝试使用 C# 执行命令行脚本时出现 System.InvalidOperation 异常

C#中的PHP MCRYPT_RIJNDAEL_128加密

java - 使用 Bouncy CaSTLe 生成 key 对

.net - 如何将对象注入(inject) WCF 验证器类