title: Read WCF service endpoint address by name from web.config
body: <p>Here I am trying to read my service endpoint address by name from web.config</p>
  
  <pre><code>ClientSection clientSection = (ClientSection)ConfigurationManager.GetSection("system.serviceModel/client");
  var el = clientSection.Endpoints("SecService"); // I don't want to use index here as more endpoints may get added and its order may change
  string addr = el.Address.ToString();
  </code></pre>
  
  <p>Is there a way I can read end point address based on name?</p>
  
  <p>Here is my <code>web.config</code> file</p>
  
  <pre><code>&lt;system.serviceModel&gt;
   &lt;client&gt;
       &lt;endpoint address="https://....................../FirstService.svc" binding="wsHttpBinding" bindingConfiguration="1ServiceBinding" contract="abc.firstContractName" behaviorConfiguration="FirstServiceBehavior" name="FirstService" /&gt;
       &lt;endpoint address="https://....................../SecService.svc" binding="wsHttpBinding" bindingConfiguration="2ServiceBinding" contract="abc.secContractName" behaviorConfiguration="SecServiceBehavior" name="SecService" /&gt;
       &lt;endpoint address="https://....................../ThirdService.svc" binding="wsHttpBinding" bindingConfiguration="3ServiceBinding" contract="abc.3rdContractName" behaviorConfiguration="ThirdServiceBehavior" name="ThirdService" /&gt;
              &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>This will work <code>clientSection.Endpoints[0];</code>, but I am looking for a way to retrieve by name.</p>
  
  <p>I.e. something like <code>clientSection.Endpoints["SecService"]</code>, but it's not working.</p>