WCF quel devrait être le endpointConfigurationName?

J'ai la configuration suivante pour mon service WCF:

<system.serviceModel>
<services>
  <service behaviorConfiguration="After.BehaviourConfig" name="ServiceInstancingDemo.Service1">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="After.BindingConfig"
      name="After.ConfigName" contract="ServiceInstancingDemo.IService1">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://rb-t510/NGCInstancing/Service1.svc" />
      </baseAddresses>
    </host>
  </service>
</services>
<bindings>
  <wsHttpBinding>
    <binding name="After.BindingConfig" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" maxBufferPoolSize="524288111" maxReceivedMessageSize="524288111" allowCookies="false">
      <security mode="None" />
    </binding>
  </wsHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="After.BehaviourConfig">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentCalls="30" maxConcurrentInstances="2147483647" maxConcurrentSessions="30" />
    </behavior>
  </serviceBehaviors>
</behaviors>

Je suis en mesure d'appeler le service client code:

NGC.Service1Client ngc = new NGC.Service1Client();

        var taskA = Task<string>.Factory.StartNew(() => ngc.WaitThenReturnString(5));

        this.listBox1.Items.Add(taskA.Result);

De la config pour le client qui appelle le service est comme suit:

 <system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="Before" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" maxBufferPoolSize="524288111"
maxReceivedMessageSize="524288111" allowCookies="false" />
<binding name="After" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" maxBufferPoolSize="524288111"
maxReceivedMessageSize="524288111" allowCookies="false">
<security mode="None" />
</binding>
<binding name="WSHttpBinding_IService1" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://rb-t510/NGCInstancing/Service1.svc"
binding="wsHttpBinding" bindingConfiguration="Before" contract="NGCInstance.IService1"
name="Before" />
<endpoint address="http://rb-t510/NGCInstancing/Service1.svc"
binding="wsHttpBinding" bindingConfiguration="After" contract="NGCInstance.IService1"
name="After" />
<endpoint address="http://rb-t510/NGCInstancing/Service1.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1"
contract="NGC.IService1" name="WSHttpBinding_IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>

Problème est que je veux ajouter un autre point de terminaison qui exécutera les mêmes fonctionnalités mais avec un comportement différent. Pour ce faire, je pense que je vais avoir besoin de passer une chaîne de caractères de la enpointConfigurationName dans le constructeur de la ligne=new NGC.Service1Client. Je ne sais pas quelle chaîne j'ai besoin de passer - j'aurais attendu qu'elle soit le point de terminaison du nom de la configuration "Après.ConfigName" mais j'ai essayé et j'ai obtenu le message d'erreur suivant:

Ne pouvait pas trouver d'extrémité de l'élément avec le nom " Après.ConfigName' et contrat " NGC.IService1 " dans le ServiceModel section de configuration de client. Ce pourrait être parce que le fichier de configuration n'a été trouvé pour votre application, ou parce qu'aucun d'extrémité de l'élément correspondant à ce nom peut être trouvé dans le client de l'élément.

Quelqu'un peut s'il vous plaît aider?

source d'informationauteur Rob Bowman