title: IIS 7.5 Wcf https WSDL always returns blank (bad request)
body: <p>Everything else works fine, I can make SOAP and RESTful calls w/o issue via https.  But WSDL always returns blank (bad request).  HTTP returns WSDL fine.</p>
  
  <p>Trace log inner exception reports:</p>
  
  <pre><code>The body of the message cannot be read because it is empty.
  </code></pre>
  
  <p>serviceMetaData tag is set:</p>
  
  <pre><code>&lt;serviceMetadata
  httpGetEnabled="true"
  policyVersion="Policy15"
  httpsGetEnabled="true" /&gt;
  </code></pre>
  
  <p>web.Config sections
  Binding:</p>
  
  <pre><code>    &lt;bindings&gt;
          &lt;basicHttpBinding&gt;
              &lt;binding name="soapBinding"&gt;
                  &lt;security mode="None"&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
          &lt;/basicHttpBinding&gt;
          &lt;webHttpBinding&gt;
              &lt;binding name="webBinding"&gt;
                  &lt;security mode="None"&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
          &lt;/webHttpBinding&gt;
      &lt;/bindings&gt;
  </code></pre>
  
  <p>You will immediately notice security mode="None"</p>
  
  <p>Via ServiceHostFactory I see the mode to transport as:</p>
  
  <pre><code>        ServiceHost serviceHost = new ServiceHost(service.GetType(), baseAddresses);
  
          if (ExposeSSL(baseAddresses[0]))
          {
              foreach (var endpoint in serviceHost.Description.Endpoints)
              {
                  if (endpoint.Binding is WebHttpBinding)
                  {
                      ((WebHttpBinding)endpoint.Binding).Security.Mode = WebHttpSecurityMode.Transport;
                      endpoint.Address = new EndpointAddress(baseAddresses[0].ToString().Replace("http", "https"));
                  }
                  if (endpoint.Binding is BasicHttpBinding)
                  {
                      ((BasicHttpBinding)endpoint.Binding).Security.Mode = BasicHttpSecurityMode.Transport;
                      endpoint.Address = new EndpointAddress(baseAddresses[0].ToString().Replace("http", "https"));
                  }
              }
  </code></pre>
  
  <p>Services configuration:</p>
  
  <pre><code>        &lt;service name="xxxx.Wcf.AdminJsonService" behaviorConfiguration="DefaultBehaviour"&gt;
              &lt;host&gt;
                  &lt;baseAddresses&gt;
                      &lt;!-- note, choose an available port--&gt;
                      &lt;add baseAddress="http://localhost:62701/json"/&gt;
                  &lt;/baseAddresses&gt;
              &lt;/host&gt;
              &lt;!-- Service Endpoints --&gt;
              &lt;endpoint address="" binding="webHttpBinding" bindingConfiguration="webBinding" behaviorConfiguration="jsonBehavior" bindingNamespace="https://www.xxxx/WebService4/AdminJsonService" contract="xxxx.Wcf.IAdminJsonService"/&gt;
          &lt;/service&gt;
  
          &lt;service name="xxxx.Wcf.AdminXmlService" behaviorConfiguration="DefaultBehaviour"&gt;
              &lt;host&gt;
                  &lt;baseAddresses&gt;
                      &lt;!-- note, choose an available port--&gt;
                      &lt;add baseAddress="http://localhost:62701/xml"/&gt;
                  &lt;/baseAddresses&gt;
              &lt;/host&gt;
              &lt;!-- Service Endpoints --&gt;
              &lt;endpoint address="" binding="webHttpBinding" bindingConfiguration="webBinding" behaviorConfiguration="poxBehavior" bindingNamespace="https://www.xxx/WebService4/AdminXmlService" contract="xxxx.Wcf.IAdminXmlService"/&gt;
          &lt;/service&gt;
  
          &lt;service name="xxxx.Wcf.AdminSoapService" behaviorConfiguration="DefaultBehaviour"&gt;
              &lt;!-- Service Endpoints --&gt;
              &lt;endpoint binding="basicHttpBinding" behaviorConfiguration="soapBehavior" bindingNamespace="https://www.example.com/WebService4/AdminSoapService" contract="xxxx.Wcf.IAdminSoapService"/&gt;
              &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
          &lt;/service&gt;
  </code></pre>
  
  <p>Endpoint behaviours</p>
  
  <pre><code>            &lt;!-- SOAP --&gt;
              &lt;behavior name="soapBehavior"&gt;
              &lt;/behavior&gt;
              &lt;!-- JSON --&gt;
              &lt;behavior name="jsonBehavior"&gt;
                  &lt;webHttp/&gt;
              &lt;/behavior&gt;
              &lt;!-- POX --&gt;
              &lt;behavior name="poxBehavior"&gt;
                  &lt;webHttp/&gt;
              &lt;/behavior&gt;
  </code></pre>
  
  <p>Service Behaviours</p>
  
  <pre><code>            &lt;behavior name="ErrorBehaviour"&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
              &lt;/behavior&gt;
              &lt;behavior name="DefaultBehaviour"&gt;
                  &lt;NiceErrorHandler/&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;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
                  &lt;serviceMetadata
                      httpGetEnabled="true"
                      policyVersion="Policy15"
                      httpsGetEnabled="true" /&gt;
              &lt;/behavior&gt;
  </code></pre>
  
  <p>Also have</p>
  
  <pre><code>    &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/&gt;
  </code></pre>
  
  <p>Anyone have idea's why this may be occurring?</p>