title: EndpointNotFoundException in WCF
body: <p>I have been staring at the web.config way to long, could you guys have a look?</p>
  
  <p>Running <code>service.Endpoint.Address.ToString()</code> gives me the expected result: <code>http://localhost:2867/Service1.svc</code> and <code>http://localhost:2867/Service1.svc?wsdl</code> gives me all the methods I need.</p>
  
  <p>If you need more info/code i'd be happy to add it.</p>
  
  <p>Thanks for having a look!</p>
  
  <hr>
  
  <p><strong>The Error</strong>  </p>
  
  <p>There was no endpoint listening at <code>http://localhost:2867/Service1.svc</code> that could accept the message. This is often caused by an incorrect address or SOAP action.</p>
  
  <p><strong>Client config</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;    
  &lt;configuration&gt;
    &lt;appSettings&gt;
      &lt;add key="webpages:Version" value="2.0.0.0" /&gt;
      &lt;add key="webpages:Enabled" value="false" /&gt;
      &lt;add key="PreserveLoginUrl" value="true" /&gt;
      &lt;add key="ClientValidationEnabled" value="true" /&gt;
      &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
    &lt;/appSettings&gt;    
    &lt;system.web&gt;        
      &lt;httpRuntime targetFramework="4.5" /&gt;        
      &lt;compilation debug="true" targetFramework="4.5" /&gt;    
      &lt;pages&gt;
        &lt;namespaces&gt;
         ...
        &lt;/namespaces&gt;
      &lt;/pages&gt;
    &lt;/system.web&gt;    
    &lt;system.webServer&gt;
      &lt;validation validateIntegratedModeConfiguration="false" /&gt;         
    &lt;handlers&gt;
    ...    
    &lt;/handlers&gt;
    &lt;/system.webServer&gt;    
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="BasicHttpBinding_IService1" /&gt;
          &lt;binding name="Identity Management WebserviceSoap"&gt;
            &lt;security mode="Transport" /&gt;
          &lt;/binding&gt;
          &lt;binding name="Identity Management WebserviceSoap1" /&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;    
      &lt;client&gt;
        &lt;endpoint address="http://localhost:2867/Service1.svc" binding="basicHttpBinding"
          bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReferenceCDP.IService1"
          name="BasicHttpBinding_IService1" /&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>Server config</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
    &lt;/configSections&gt;
  
    &lt;appSettings&gt;
      &lt;add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /&gt;
    &lt;/appSettings&gt;
  
    &lt;system.web&gt;
  
      &lt;compilation debug="true" targetFramework="4.0"&gt;
        &lt;assemblies&gt;
          &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
        &lt;/assemblies&gt;
      &lt;/compilation&gt;
  
      &lt;httpRuntime targetFramework="4.0" /&gt;
      &lt;authorization&gt;
        &lt;allow users="?" /&gt;
      &lt;/authorization&gt;
  
    &lt;/system.web&gt;
  
    &lt;system.serviceModel&gt;    
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" /&gt;
  
      &lt;client&gt;
        &lt;!--&lt;endpoint address="https://services.howest.be/Howest.Identity.Web.Service/v1.1/facade.asmx" binding="basicHttpBinding" bindingConfiguration="Identity Management WebserviceSoap" contract="BamaFlex.IdentityManagementWebserviceSoap" name="Identity Management WebserviceSoap" /&gt;--&gt;
      &lt;/client&gt;
  
      &lt;services&gt;
        &lt;service name="CollectiveDistributedPolling.Service1" behaviorConfiguration="ServiceBehavior"&gt;
          &lt;endpoint address="" binding="webHttpBinding" behaviorConfiguration="json" contract="CollectiveDistributedPolling.IService1"&gt;&lt;/endpoint&gt;        
        &lt;/service&gt;
      &lt;/services&gt;
  
      &lt;behaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior name="json"&gt;
            &lt;enableWebScript /&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
  
  
        &lt;serviceBehaviors&gt;
          &lt;behavior name="ServiceBehavior"&gt;
            &lt;serviceMetadata httpGetEnabled="true"/&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
  
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="Identity Management WebserviceSoap"&gt;
            &lt;security mode="Transport" /&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
  
        &lt;webHttpBinding&gt;
          &lt;binding&gt;
            &lt;readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="64" maxNameTableCharCount="2147483647" /&gt;
            &lt;security mode="None" /&gt;
          &lt;/binding&gt;
        &lt;/webHttpBinding&gt;
      &lt;/bindings&gt;
  
    &lt;/system.serviceModel&gt;
  
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true" /&gt;
  
      &lt;!--Toegevoegd omdat de browser anders nx ontvangt (GET)--&gt;
      &lt;httpProtocol&gt;
        &lt;customHeaders&gt;
          &lt;add name="Access-Control-Allow-Origin" value="*" /&gt;
        &lt;/customHeaders&gt;
      &lt;/httpProtocol&gt;
  
      &lt;directoryBrowse enabled="true" /&gt;
  
    &lt;/system.webServer&gt;
  
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /&gt;
    &lt;/entityFramework&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>&lt;services&gt;
        &lt;service name="CollectiveDistributedPolling.Service1" behaviorConfiguration="ServiceBehavior"&gt;
          &lt;endpoint address="http://localhost:2867/Service1.svc" binding="webHttpBinding" behaviorConfiguration="json" contract="CollectiveDistributedPolling.IService1"&gt;&lt;/endpoint&gt;        
        &lt;/service&gt;
      &lt;/services&gt;
  </code></pre>