none
An endpoint configuration section for contract could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name. RRS feed

  • Question

  • Hi,

    I got the following error when i added the 

    net.tcp:// into my app.config.

    "An endpoint configuration section for contract  could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name."

    Please let me know if i did wrong.

    here is my app.config from Service 

    <system.serviceModel>

    <bindings>

    <wsHttpBinding>

    <binding name="TransactionalWS" transactionFlow="true">

    <reliableSession enabled="true" />

    </binding>

    </wsHttpBinding>

    <netTcpBinding>

    <binding name="TransactionalTCP" transactionFlow="true">

    <reliableSession enabled="true" />

    </binding>

    </netTcpBinding>

    </bindings>

    <behaviors>

    <serviceBehaviors>

    <behavior name="DCCPP.ServiceImplementation.DCCPPManagerService_Behavior">

    <serviceDebug includeExceptionDetailInFaults="false" />

    <serviceMetadata httpGetEnabled="true" />

    </behavior>

    </serviceBehaviors>

    </behaviors>

    <services>

    <service behaviorConfiguration="DCCPP.ServiceImplementation.DCCPPManagerService_Behavior"

     

    name="DCCPP.ServiceImplementation.DCCPPManagerService">

    <clear />

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

    <endpoint name="wsAdmin" address="admin" binding="wsHttpBinding"

    bindingConfiguration="TransactionalWS"

    bindingNamespace="http://DCCPP.ServiceContracts/2008/10"

     

    contract="DCCPP.ServiceContracts.IAdminService" />

    <endpoint name="wsEntity" address="entity" binding="wsHttpBinding"

    bindingConfiguration="TransactionalWS"

    bindingNamespace="http://DCCPP.ServiceContracts/2008/10"

     

    contract="DCCPP.ServiceContracts.IEntityService" />

    <endpoint name="wsCurrency" address="currency" binding="wsHttpBinding"

    bindingConfiguration="TransactionalWS"

    bindingNamespace="http://DCCPP.ServiceContracts/2008/10"

     

    contract="DCCPP.ServiceContracts.ICurrencyService" />

    <endpoint address="mex" binding="mexTcpBinding" name="netMex" contract="IMetadataExchange" />

    <endpoint name="netAdmin" address="admin" binding="netTcpBinding"

    bindingConfiguration="TransactionalTCP"

     

    bindingNamespace="http://DCCPP.ServiceContracts/2008/10"

     

    contract="DCCPP.ServiceContracts.IAdminService" />

    <endpoint name="netEntity" address="entity" binding="netTcpBinding"

     

    bindingConfiguration="TransactionalTCP"

     

    bindingNamespace="http://DCCPP.ServiceContracts/2008/10"

     

    contract="DCCPP.ServiceContracts.IEntityService" />

    <endpoint name="netCurrency" address="currency" binding="netTcpBinding"

     

    bindingConfiguration="TransactionalTCP"

     

    bindingNamespace="http://DCCPP.ServiceContracts/2008/10"

     

    contract="DCCPP.ServiceContracts.ICurrencyService" />

    <host>

    <baseAddresses>

    <add baseAddress="http://localhost:8080/DCCPPService"/>

    <add baseAddress="net.tcp://localhost:8082/DCCPPService" />

    </baseAddresses>

    </host>

    </service>

    </services>

    </system.serviceModel>


    Monday, December 15, 2008 7:23 AM

Answers

All replies

  •  Here is my app.config from Client

    <system.serviceModel>

    <bindings>

    <netTcpBinding>

    <binding name="netAdmin" closeTimeout="00:01:00" openTimeout="00:01:00"

    receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"

    transferMode="Buffered" transactionProtocol="OleTransactions"

    hostNameComparisonMode="StrongWildcard" listenBacklog="10"

    maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"

    maxReceivedMessageSize="65536">

    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

    maxBytesPerRead="4096" maxNameTableCharCount="16384" />

    <reliableSession ordered="true" inactivityTimeout="00:10:00"

    enabled="false" />

    <security mode="Transport">

    <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />

    <message clientCredentialType="Windows" />

    </security>

    </binding>

    <binding name="netEntity" closeTimeout="00:01:00" openTimeout="00:01:00"

    receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"

    transferMode="Buffered" transactionProtocol="OleTransactions"

    hostNameComparisonMode="StrongWildcard" listenBacklog="10"

    maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"

    maxReceivedMessageSize="65536">

    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

    maxBytesPerRead="4096" maxNameTableCharCount="16384" />

    <reliableSession ordered="true" inactivityTimeout="00:10:00"

    enabled="false" />

    <security mode="Transport">

    <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />

    <message clientCredentialType="Windows" />

    </security>

    </binding>

    <binding name="netCurrency" closeTimeout="00:01:00" openTimeout="00:01:00"

    receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"

    transferMode="Buffered" transactionProtocol="OleTransactions"

    hostNameComparisonMode="StrongWildcard" listenBacklog="10"

    maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"

    maxReceivedMessageSize="65536">

    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

    maxBytesPerRead="4096" maxNameTableCharCount="16384" />

    <reliableSession ordered="true" inactivityTimeout="00:10:00"

    enabled="false" />

    <security mode="Transport">

    <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />

    <message clientCredentialType="Windows" />

    </security>

    </binding>

    </netTcpBinding>

    <wsHttpBinding>

    <binding name="wsCurrency" closeTimeout="00:01:00" openTimeout="00:01:00"

    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"

    transactionFlow="true" 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="true" />

    <security mode="Message">

    <transport clientCredentialType="Windows" proxyCredentialType="None"

    realm="" />

    <message clientCredentialType="Windows" negotiateServiceCredential="true"

    algorithmSuite="Default" establishSecurityContext="true" />

    </security>

    </binding>

    <binding name="wsAdmin" closeTimeout="00:01:00" openTimeout="00:01:00"

    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"

    transactionFlow="true" 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="true" />

    <security mode="Message">

    <transport clientCredentialType="Windows" proxyCredentialType="None"

    realm="" />

    <message clientCredentialType="Windows" negotiateServiceCredential="true"

    algorithmSuite="Default" establishSecurityContext="true" />

    </security>

    </binding>

    <binding name="wsEntity" closeTimeout="00:01:00" openTimeout="00:01:00"

    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"

    transactionFlow="true" 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="true" />

    <security mode="Message">

    <transport clientCredentialType="Windows" proxyCredentialType="None"

    realm="" />

    <message clientCredentialType="Windows" negotiateServiceCredential="true"

    algorithmSuite="Default" establishSecurityContext="true" />

    </security>

    </binding>

    </wsHttpBinding>

    </bindings>

    <client>

    <endpoint address="http://localhost:8080/DCCPPService/admin"

    binding="wsHttpBinding" bindingConfiguration="wsAdmin" contract="DCCPPServiceProxy.AdminService"

    name="wsAdmin">

    <identity>

    <userPrincipalName value="alexaung@scscorp.scssystem.com" />

    </identity>

    </endpoint>

    <endpoint address="http://localhost:8080/DCCPPService/entity"

    binding="wsHttpBinding" bindingConfiguration="wsEntity" contract="DCCPPServiceProxy.EntityService"

    name="wsEntity">

    <identity>

    <userPrincipalName value="alexaung@scscorp.scssystem.com" />

    </identity>

    </endpoint>

    <endpoint address="http://localhost:8080/DCCPPService/currency"

    binding="wsHttpBinding" bindingConfiguration="wsCurrency" contract="DCCPPServiceProxy.CurrencyService"

    name="wsCurrency">

    <identity>

    <userPrincipalName value="alexaung@scscorp.scssystem.com" />

    </identity>

    </endpoint>

    <endpoint address="net.tcp://localhost:8082/DCCPPService/admin"

    binding="netTcpBinding" bindingConfiguration="netAdmin" contract="DCCPPServiceProxy.AdminService"

    name="netAdmin">

    <identity>

    <userPrincipalName value="alexaung@scscorp.scssystem.com" />

    </identity>

    </endpoint>

    <endpoint address="net.tcp://localhost:8082/DCCPPService/entity"

    binding="netTcpBinding" bindingConfiguration="netEntity" contract="DCCPPServiceProxy.EntityService"

    name="netEntity">

    <identity>

    <userPrincipalName value="alexaung@scscorp.scssystem.com" />

    </identity>

    </endpoint>

    <endpoint address="net.tcp://localhost:8082/DCCPPService/currency"

    binding="netTcpBinding" bindingConfiguration="netCurrency" contract="DCCPPServiceProxy.CurrencyService"

    name="netCurrency">

    <identity>

    <userPrincipalName value="alexaung@scscorp.scssystem.com" />

    </identity>

    </endpoint>

    </client>

    </system.serviceModel>

    Monday, December 15, 2008 7:23 AM
  • When you create your client you should give it the endpoint name in the constructor. The name is one of these that appear in your config: wsEntity, wsCurrency, netEntity...


    http://webservices20.blogspot.com/
    WCF Security, Performance And Testing Blog
    • Marked as answer by Bin-ze Zhao Tuesday, December 23, 2008 6:28 AM
    • Unmarked as answer by Bin-ze Zhao Tuesday, December 23, 2008 6:28 AM
    • Marked as answer by Bin-ze Zhao Tuesday, December 23, 2008 6:28 AM
    Tuesday, December 16, 2008 10:23 AM
  •  Hi AlexAung:

    Yaron has given a great solution for this error genenated on client side for invoking the proper endpoint service.
    The solution is also decribed in this blog in detail:
    http://blogs.msdn.com/nikolad/archive/2008/08/27/troubleshooting-an-endpoint-configuration-section-for-contract-could-not-be-loaded-because-more-than-one-endpoint-configuration-for-that-contract-was-found-error.aspx

    You can also check here, it will give you a clearer understanding.

    best wishes
    Binze
    • Marked as answer by AlexAung Tuesday, December 23, 2008 7:51 AM
    Tuesday, December 23, 2008 6:28 AM
  • Thanks. It is working. But I just wondering why my another project is working without specifiying any thing. :)
    Tuesday, December 23, 2008 7:49 AM