title: One service, multiple endpoints, multiple bindings on WCF. Why can't I reach my endpoints?
body: <p>I have a WCF service run by IIS. I would like to create two different clients (WPF and WP7), that are using the same service. The WPF client was already working with an endpoint using <code>wsHttpBinding</code> and <code>https</code>. Sadly WP7 doesn't do <code>wsHttpBinding</code>, only <code>BasicHttpBinding</code>. So I thought I would expose different endpoints for the two, so they could access the same service, but with different bindings and what not...</p>
  
  <p>So here is my Web.config on IIS:</p>
  
  <pre><code>&lt;configuration&gt;
  
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0" /&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name="TransportSecurity"&gt;
          &lt;reliableSession enabled="true" /&gt;
            &lt;security mode="TransportWithMessageCredential" &gt;
              &lt;transport clientCredentialType="None"/&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/wsHttpBinding&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="BasicTransportSecurity"&gt;
             &lt;security mode="Transport"&gt;
                &lt;transport clientCredentialType="None"/&gt;
             &lt;/security&gt;
           &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="SmartCook2.Server.ISmartCookServiceBehavior"&gt;
            &lt;serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
      &lt;services&gt;
        &lt;service behaviorConfiguration="SmartCook2.Server.ISmartCookServiceBehavior"
          name="SmartCook2.Server.SmartCookService"&gt;
          &lt;endpoint address="WS" binding="wsHttpBinding" bindingConfiguration="TransportSecurity"
            name="WS" contract="SmartCook2.Server.ISmartCookService" /&gt;
          &lt;endpoint address="Basic" binding="basicHttpBinding" bindingConfiguration="BasicTransportSecurity"
            name="Basic" contract="SmartCook2.Server.ISmartCookService" /&gt;
          &lt;endpoint address="mex" binding="mexHttpsBinding" name="mex"
            contract="IMetadataExchange" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
    &lt;/system.serviceModel&gt;
   &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
    &lt;/system.webServer&gt;
  &lt;connectionStrings&gt;
      &lt;add name="SmartCookDBEntities" connectionString="metadata=res://*/SmartCookContext.csdl|res://*/SmartCookContext.ssdl|res://*/SmartCookContext.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=RENDERBETYAR;initial catalog=SmartCookDB;integrated security=True;pooling=False;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt;
    &lt;/connectionStrings&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Now if I got it right the endpoints should be accessible on the following addresses:</p>
  
  <pre><code>https://localhost/IISHostedSmartCook/SmartCookService.svc/Basic
  https://localhost/IISHostedSmartCook/SmartCookService.svc/WS
  https://localhost/IISHostedSmartCook/SmartCookService.svc/mex
  </code></pre>
  
  <p>If I check them in my browser I get nothing. There's no exception, but no content either. Using the base address (till the .svc part) I get the default service page and I can access the wsdl and it is valid. It has the endpoints, my service's methods etc correctly as far as I can tell.</p>
  
  <p>If I try to add the ServiceReference to my WP7 project is Visual Studio, I can only see my service under the base address (specific endpoint addresses return nothing). If I add it, the classes are generated about right, only I can't call any of my service's methods and I get the error message "There is no endpoint listening at this address". (This also happens if I use the service client's constructor requiring the endpoint's name.)</p>
  
  <p>What am I doing wrong?</p>