title: WCF service returns 404 over https but not http
body: <p>I'm migrating an existing service from HTTP (Dev/UAT) to HTTPS (Production), and I'm having trouble with the configuration.  Here is the system.serviceModel section of my web.config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name=""&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="false" /&gt;
      &lt;services&gt;
        &lt;service name="MyService"&gt;
          &lt;endpoint name="MyEndpoint" address="" binding="wsHttpBinding"
              bindingConfiguration="secureBinding" contract="IMyService" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;bindings&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name="secureBinding"&gt;
            &lt;security mode="Transport"&gt;&lt;/security&gt;
          &lt;/binding&gt;
        &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>I've tried this using both <code>basicHttpBinding</code> and <code>wsHttpBinding</code>, with the same results: </p>
  
  <ul>
  <li>I can call the service from my SOAP client using <code>http://server.domain.com/MyService.svc</code></li>
  <li>I can hit the service from a browser using <code>https://server.domain.com/MyService.svc</code></li>
  <li>I can't call the service from my SOAP client using <code>https://server.domain.com/MyService.svc</code> - the call always errors with <code>404: not found</code>.</li>
  </ul>
  
  <p>My https site is certified using a certificate that was issued by a CA on the corporate domain, and I've verified that I have that CA's certificate installed in <code>Trusted Root Certification Authorities</code> on the system from which I'm making the calls.</p>
  
  <p>The relevant client code:</p>
  
  <pre><code>Service service = new Service();
  service.Url = "http://server.domain.com/MyService.svc";
  //service.Url = "https://server.domain.com/MyService.svc";
  service.WebMethodCall();
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here are the requested portions of the WSDL:</p>
  
  <pre><code>&lt;wsdl:types/&gt;
  &lt;wsdl:portType name="IMyService"/&gt;
  &lt;wsdl:binding name="BasicHttpBinding_IMyService" type="tns:IMyService"&gt;
      &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:service name="MyService"&gt;
      &lt;wsdl:port name="BasicHttpBinding_IMyService" 
          binding="tns:BasicHttpBinding_IMyService"&gt;
          &lt;soap:address location="http://server.domain.com/MyService.svc"/&gt;
      &lt;/wsdl:port&gt;
  &lt;/wsdl:service&gt;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>More information:</p>
  
  <p>When I change the serviceMetadata element to have <code>httpGetEnabled="false"</code> and <code>httpsGetEnabled="true"</code> the .svc page shows me the following link:</p>
  
  <pre><code>https://boxname.domain.com/MyService.svc?wsdl
  </code></pre>
  
  <p>rather than the expected</p>
  
  <pre><code>https://server.domain.com/MyService.svc?wsdl
  </code></pre>