locked
Error: A binding instance has already been associated to listen URI RRS feed

  • Question

  • Hello. I have the following problem:

    I'm trying to configure a WCF DataService, but it keeps throwing an error. Currently this web service works properly in another local server. Besides Dataservice I have another service for managing images.

    Here there is a solution, but do not work for me: http://stackoverflow.com/questions/11506107/wcf-invalidoperationexception-a-binding-instance-has-already-been-associated-to

    ERROR:

    A binding instance has already been associated to listen URI 'http://domain.com/wsData/DataService.svc'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config.

     web.config:

    <?xml version="1.0" encoding="utf-8"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
      <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
      </configSections>
      <system.web>
        <customErrors mode="Off"></customErrors>
        <compilation >
          <assemblies>
            <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
          </assemblies>
        </compilation>
        <!--<httpRuntime targetFramework="4.5" />-->
    
    
      </system.web>
    
      <system.serviceModel>
    
        <bindings>
          <webHttpBinding>
            <binding
              maxBufferPoolSize="2147483647"
              maxReceivedMessageSize="2147483647"
              maxBufferSize="2147483647" transferMode="Streamed">
              <security mode="None">
                <transport clientCredentialType="None" />
              </security>
            </binding>
          </webHttpBinding>
        </bindings>
    
        <behaviors>
          <serviceBehaviors>
    
            <behavior name="ServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
    
          </serviceBehaviors>
    
          <endpointBehaviors>
            <behavior name="EndpBehavior">
              <webHttp/>
            </behavior>
          </endpointBehaviors>
    
        </behaviors>
        <services>
    
          <service behaviorConfiguration="ServiceBehavior" name="wsPALLQC.ImagenHandler">
    
            <endpoint address="ImagenHandler.svc" binding="webHttpBinding"
                contract="wsPALLQC.IImagenHandler" behaviorConfiguration="EndpBehavior" listenUri="/">
            </endpoint>
            
          </service>
    
          
          
        </services>
    
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
    
      <connectionStrings>
    
        <add name="QCEntities" connectionString="metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=host;initial catalog=db;persist security info=True;user id=user;password=pass;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    
      </connectionStrings>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
      </entityFramework>
    
    
      <system.webServer>
    
        <security>
          <authentication>
            <anonymousAuthentication enabled="true"/>
            <windowsAuthentication enabled="false"/>
            <basicAuthentication enabled="false"/>
          </authentication>
        </security>
    
        <modules >
          <add name="WcfReadEntityBodyModeWorkaroundModule" type="wsPALLQC.WcfReadEntityBodyModeWorkaroundModule, wsPALLQC" />
        </modules>
    
      </system.webServer>
    </configuration>

    In advance thank you very much for any help.

    Friday, December 11, 2015 4:26 PM