【问题标题】:How do I set WCF endpoint identity configuration programmatically?如何以编程方式设置 WCF 终结点标识配置?
【发布时间】:2011-06-16 18:36:37
【问题描述】:

如何像下面的其他配置一样以编程方式设置 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";  

【问题讨论】:

    标签: wcf c#-4.0


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2011-01-04
      • 2021-08-09
      • 2013-12-23
      • 1970-01-01
      • 2011-11-23
      • 1970-01-01
      • 2017-04-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多