title: WCF SOAP over HTTPS, WCF Test Client calls the http address and the server responds with 404
body: <p>TL;DR version is at the bottom.</p>
  
  <p>I have constructed three WCF web services -- one that's using .NET 4 and two that's using .NET 3.5 -- that is consumed by an Android client. The Android client performs the calls using ksoap2-android. When the services were complete and the client could make all the calls and get all the data from the services, we decided to activate HTTPS communication for the web services. They are hosted on a server running IIS.</p>
  
  <p>I'm not alone on this task. I work full-time with it, mainly the Android client. I have two coworkers, both of which have a lot of other responsibilities. The first is mostly involved in the services and the second is mostly involved in the server.</p>
  
  <p>I've read a lot of guides, blogs and articles on the Internet on how to enable HTTPS for a WCF web service, but still I haven't been able to completely resolve this. For the Android client to be able to consume the client, we are limited to using the basicHttpBinding, since the wsHttpBinding contains some security details that are not supported by Android, or something. I'm not sure, but I read it some forum somewhere. If I'm wrong, I'd happily be corrected!</p>
  
  <p><strong>Okay, so I'll give a short account of what I've done so far:</strong></p>
  
  <p>I've <strong>enabled transport security</strong>, this is how the binding(s) looks:</p>
  
  <pre><code>&lt;bindings&gt;
    &lt;basicHttpBinding&gt;
      &lt;binding name="basicHttp" closeTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"&gt;
        &lt;security mode="Transport"&gt;
          &lt;transport clientCredentialType="None" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/basicHttpBinding&gt;
  &lt;/bindings&gt;
  </code></pre>
  
  <p>I've <strong>enabled meta data publishing over HTTPS</strong> using this line of code:</p>
  
  <pre><code>&lt;serviceMetadata httpsGetEnabled="true" /&gt;
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>&lt;endpoint address="" binding="mexHttpsBinding" contract="IMetadataExchange" /&gt;
  </code></pre>
  
  <p>Also, my second coworker has <strong>installed a trusted certificate</strong> (a real certificate from a CA) on the IIS server and <strong>added a https binding</strong> on the server.</p>
  
  <p>Okay, so far, so good. Now we could connect to the services in the browser.</p>
  
  <p>When we had done this it was possible to visit the service in the browser in a secure, encrypted, manner.</p>
  
  <p>The problem is that it isn't possible to make a call to the service, neither in Android nor WCF Test Client. If I call the service on the https address, I get a 404 in response. WCF Test Client returns this:</p>
  
  <pre><code>There was no endpoint listening at https://[my service address] that could accept the message. This is often caused by an incorrect address or SOAP action.
  </code></pre>
  
  <p>To be able to debug this, I'm using Wireshark to intercept the messages and see what really happens. I've found out that after the set up procedures (handshake, establishing trust etc.) the client sends the header and get a 101 Continue in response, after which it POSTs the body. This should be normal behavior. But then the service returns 404 Not Found. Wireshark says that the full request URI is the http address. I've configured the server to use the https address, so why does it make a call to the http address?</p>
  
  <p>I've tried setting the address and listenUri attribute of the endpoint to https and http respectively and the other way around. If I do that, the server answers the request with 405 Method Not Allowed.</p>
  
  <p>Is there any way to solve this? What am I missing?</p>
  
  <p>What am I missing?</p>
  
  <p><strong>TL;DR version below</strong></p>
  
  <p>I'm hosting three WCF SOAP web services with IIS, one using .NET 4 and the others using .NET 3.5. I'm trying to make a call from the WCF Test Client over HTTPS. I've enabled transport security, meta data publishing over HTTPS, installed a trusted certificate and added a https binding on the server.</p>
  
  <p>When I try to make a call from WCF Test Client it says that there was no endpoint listening at the address. Wireshark tells me it makes the call to the http version of the service (i.e. "http://[my address]" instead of "https://[my address]"), although it is configured to call the https address. The service returns 404 Not Found. If I set the address of the service to https and listenUri to http, I get 405 Method Not Allowed. If I do it the other way around it says that it cannot be activated. What am I missing?</p>