title: WCF can't find the endpoint configuration issue
body: <p>I have a webservice with WCF I'm testing on my local machine that's giving me a headscratcher.</p>
  
  <p>My service is configured like so:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
     &lt;services&gt;
        &lt;service name="GHMDatroseIntegration.GHMDatroseWCFService.DatroseService" 
                 behaviorConfiguration="DatroseServiceBehavior"&gt;
           &lt;endpoint 
               address="mex"
               binding="basicHttpBinding" 
               contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService" /&gt;
        &lt;/service&gt;
     &lt;/services&gt;
     &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
           &lt;behavior name="DatroseServiceBehavior"&gt;
              &lt;serviceMetadata httpGetEnabled="true"/&gt;
              &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
              &lt;dataContractSerializer maxItemsInObjectGraph="2147483647"/&gt;
           &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
     &lt;/behaviors&gt;
     &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>My client is configured like so:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
     &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
           &lt;binding name="BasicHttpBinding_IDatroseService" 
               closeTimeout="00:02:00" openTimeout="00:01:00" 
               receiveTimeout="00:10:00" sendTimeout="00:02:00"
               allowCookies="false" bypassProxyOnLocal="false" 
               hostNameComparisonMode="StrongWildcard"
               maxBufferSize="524288" maxBufferPoolSize="524288" 
               maxReceivedMessageSize="524288" 
               messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
               useDefaultWebProxy="true"&gt;
              &lt;readerQuotas 
                   maxDepth="32" maxStringContentLength="524288" 
                   maxArrayLength="524288" maxBytesPerRead="524288" 
                   maxNameTableCharCount="524288" /&gt;
              &lt;security mode="None"&gt;
                   &lt;transport clientCredentialType="None" proxyCredentialType="None"
                              realm="" /&gt;
                   &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
              &lt;/security&gt;
           &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
     &lt;/bindings&gt;
     &lt;client&gt;
         &lt;endpoint name="BasicHttpBinding_IDatroseService"
             address="http://localhost/DatroseWCFService/DatroseService.svc"  
             behaviorConfiguration="DatroseServiceBehavior"
             binding="basicHttpBinding"  
             bindingConfiguration="BasicHttpBinding_IDatroseService"
             contract="DatroseWCFService.IDatroseService"  /&gt;
     &lt;/client&gt;
     &lt;behaviors&gt;
        &lt;endpointBehaviors&gt;
           &lt;behavior name="DatroseServiceBehavior"&gt;
               &lt;dataContractSerializer maxItemsInObjectGraph="2147483647"/&gt;
           &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
     &lt;/behaviors&gt;
   &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>The error I receive is:</p>
  
  <blockquote>
    <p>There was no endpoint listening at <a href="http://localhost/DatroseWCFService/DatroseService.svc" rel="nofollow">http://localhost/DatroseWCFService/DatroseService.svc</a> that could
    accept the message. This is often caused by an incorrect address or
    SOAP action. See InnerException, if present, for more details.</p>
  </blockquote>
  
  <p>... and yet, if I browse to the location I get the service screen, so it appears to be set up properly.</p>
  
  <p>I'm sure this has do do with my configuration of the endpoints, but I can't figure out what they are supposed to look like.  Some help would be appreciated here.</p>
  
  <p><strong>UPDATE</strong> whups I put the wrong error message in.  It's fixed now.</p>
  
  <p><strong>UPDATE 2</strong> per what I believe has been suggested in these responses I have changed my server config to :</p>
  
  <pre><code>&lt;system.serviceModel&gt;
     &lt;services&gt;
        &lt;service name="GHMDatroseIntegration.GHMDatroseWCFService.DatroseService" 
                 behaviorConfiguration="DatroseServiceBehavior"&gt;
           &lt;endpoint 
               address="/svc"
               binding="basicHttpBinding"
               contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService"  /&gt;
           &lt;endpoint 
               address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
         &lt;/service&gt;
     &lt;/services&gt;
     &lt;behaviors&gt;
         &lt;serviceBehaviors&gt;
            &lt;behavior name="DatroseServiceBehavior"&gt;
               &lt;serviceMetadata httpGetEnabled="true"/&gt;
               &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
               &lt;dataContractSerializer maxItemsInObjectGraph="2147483647"/&gt;
            &lt;/behavior&gt;
         &lt;/serviceBehaviors&gt;
     &lt;/behaviors&gt;
     &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>and my client configuration to: </p>
  
  <pre><code>&lt;system.serviceModel&gt;
     &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
           &lt;binding name="BasicHttpBinding_IDatroseService" 
               closeTimeout="00:02:00" openTimeout="00:01:00" 
               receiveTimeout="00:10:00" sendTimeout="00:02:00"
               allowCookies="false" bypassProxyOnLocal="false" 
               hostNameComparisonMode="StrongWildcard"
               maxBufferSize="524288" maxBufferPoolSize="524288" 
               maxReceivedMessageSize="524288"
               messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
               useDefaultWebProxy="true"&gt;
            &lt;readerQuotas 
                maxDepth="32" maxStringContentLength="524288" maxArrayLength="524288"
                maxBytesPerRead="524288" maxNameTableCharCount="524288" /&gt;
            &lt;security mode="None"&gt;
                &lt;transport clientCredentialType="None" proxyCredentialType="None"
                          realm="" /&gt;
                &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
            &lt;/security&gt;
         &lt;/binding&gt;
       &lt;/basicHttpBinding&gt;
     &lt;/bindings&gt;
     &lt;client&gt;
        &lt;endpoint name="BasicHttpBinding_IDatroseService" 
            address="http://localhost/DatroseWCFService/DatroseService.svc/svc" 
            behaviorConfiguration="DatroseServiceBehavior"
            binding="basicHttpBinding" 
            bindingConfiguration="BasicHttpBinding_IDatroseService"
            contract="DatroseWCFService.IDatroseService" /&gt;
     &lt;/client&gt;
     &lt;behaviors&gt;
        &lt;endpointBehaviors&gt;
           &lt;behavior name="DatroseServiceBehavior"&gt;
              &lt;dataContractSerializer maxItemsInObjectGraph="2147483647"/&gt;
           &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
     &lt;/behaviors&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>and when I run this I now get a 400 (bad request) error.  I am not sure if this is a step forward or a step back.  Have I created a new problem, or have I cleared my way to the next problem?</p>
  
  <p><strong>UPDATE 3</strong></p>
  
  <p>Upon niao' advice, I changed to this for the server config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;services&gt;
          &lt;service name="GHMDatroseIntegration.GHMDatroseWCFService.DatroseService" behaviorConfiguration="DatroseServiceBehavior"&gt;
              &lt;endpoint contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService" binding="basicHttpBinding" address="http://localhost/DatroseWCFService/DatroseService.svc"/&gt;
              &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
          &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
          &lt;serviceBehaviors&gt;
              &lt;behavior name="DatroseServiceBehavior"&gt;
                  &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
                  &lt;serviceMetadata httpGetEnabled="true"/&gt;
                  &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
                  &lt;dataContractSerializer maxItemsInObjectGraph="2147483647"/&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>...however, when I browsed to this address, I got a yellow screen of death:</p>
  
  <blockquote>
    <p>Server Error in '/DatroseWCFService' Application.<br>
    When 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'
    is set to true in configuration, the endpoints are required to specify
    a relative address. If you are specifying a relative listen URI on the
    endpoint, then the address can be absolute. To fix this problem,
    specify a relative uri for endpoint
    'http://localhost/DatroseWCFService/DatroseService.svc'.</p>
  </blockquote>
  
  <p>...so with that, I tried making it a relative path like so:</p>
  
  <pre><code>&lt;endpoint 
     address="localhost/DatroseWCFService/DatroseService.svc"
     binding="basicHttpBinding" 
     contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService" /&gt;
  </code></pre>
  
  <p>... but after publishing that, I get the 404 error. The client endpoint is configured as such:</p>
  
  <pre><code>&lt;endpoint name="BasicHttpBinding_IDatroseService"
      address="http://localhost/DatroseWCFService/DatroseService.svc" 
      behaviorConfiguration="DatroseServiceBehavior"
      binding="basicHttpBinding" 
      bindingConfiguration="BasicHttpBinding_IDatroseService"
      contract="DatroseWCFService.IDatroseService"  /&gt;
  </code></pre>
  
  <p><strong>UPDATE 4</strong>
  Per marc_s' advice, I removed the binding config from the client, so my config looks like this:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;client&gt;
          &lt;endpoint address="http://localhost/DatroseWCFService/DatroseService.svc" behaviorConfiguration="DatroseServiceBehavior"
           binding="basicHttpBinding" 
           contract="DatroseWCFService.IDatroseService" name="BasicHttpBinding_IDatroseService" /&gt;
      &lt;/client&gt;
      &lt;behaviors&gt;
          &lt;endpointBehaviors&gt;
              &lt;behavior name="DatroseServiceBehavior"&gt;
                  &lt;dataContractSerializer maxItemsInObjectGraph="10000000"/&gt;
              &lt;/behavior&gt;
          &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>and my server configuration looks like this:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;services&gt;
          &lt;service name="GHMDatroseIntegration.GHMDatroseWCFService.DatroseService" behaviorConfiguration="DatroseServiceBehavior"&gt;
              &lt;endpoint contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService" binding="basicHttpBinding" address=""/&gt;
              &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
          &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
          &lt;serviceBehaviors&gt;
              &lt;behavior name="DatroseServiceBehavior"&gt;
                  &lt;serviceMetadata httpGetEnabled="true"/&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="true" httpsHelpPageEnabled="true" httpHelpPageEnabled="true"/&gt;
                  &lt;dataContractSerializer maxItemsInObjectGraph="10000000"/&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p><strong>I no longer get the 404 error.</strong> </p>
  
  <p>However, I do get a 400 (ProtocolException, Bad Request) with no edifying information of what it got or why it's bad.  I expect I've progressed beyond the endpoint issue, into a brand new void of service configuration hell.</p>
  
  <p><strong>UPDATE 5</strong></p>
  
  <p>Per request, the "skeleton" of my service (I assume the interface will do?):</p>
  
  <pre><code>[ServiceContract]
  public interface IDatroseService
  {
  
      [OperationContract]
      bool SubmitPayableTransaction(List&lt;InvoiceItem&gt; invoices);
  
      [OperationContract]
      Dictionary&lt;string, bool&gt; ValidateAccounts(List&lt;string&gt; accounts);
  
      [OperationContract]
      Dictionary&lt;string, int&gt; GetVendor1099Types(List&lt;string&gt; vendors);
  
      [OperationContract]
      Dictionary&lt;string, string&gt; GetPaymentTerms(List&lt;string&gt; vendors);
  
  }
  </code></pre>