title: WCF hosted on SharePoint - Need to enable https
body: <p>I have a WCF hosted in SharePoint 2013 with two methods GET and SET send JSON data.  The WCF worked fine under HTTP servers but now we need to move it to production and run it under SSL where we have a certificate installed on the server.
  I made changes to the web.config file but I'm getting error 404 Not Found when I try to call the GET method.</p>
  
  <p>Here is my Web.Config (working on HTTP before the change)</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
  &lt;system.serviceModel&gt;
  &lt;services&gt;
    &lt;service name="WCF.Service" behaviorConfiguration="WCF.ServiceBehavior" &gt;
      &lt;endpoint address=""
          binding="webHttpBinding"
          contract="WCF.IService"
                /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="WCF.ServiceBehavior"&gt;
        &lt;serviceMetadata  httpGetEnabled="true"/&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior &gt;
        &lt;webHttp/&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;bindings&gt;
    &lt;webHttpBinding&gt;
      &lt;binding name="NoSecurityHttpBinding"&gt;
        &lt;security mode="None"&gt;
          &lt;transport clientCredentialType="None" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/webHttpBinding&gt;
  &lt;/bindings&gt;
  &lt;/system.serviceModel&gt;
  &lt;startup&gt;
  &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;
  &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Here is what I tried to make the code work:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
  &lt;system.serviceModel&gt;
  
  &lt;services&gt;
    &lt;service name="WCF.Service" behaviorConfiguration="WCF.ServiceBehavior" &gt;
      &lt;endpoint address=""
          binding="webHttpBinding"
          contract="WCF.IService"
                /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="WCF.ServiceBehavior"&gt;
        &lt;serviceMetadata  **httpsGetEnabled**="true"/&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior &gt;
        &lt;webHttp/&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;bindings&gt;
    &lt;webHttpBinding&gt;
      &lt;binding name="NoSecurityHttpBinding"&gt;
        &lt;security mode="**Transport**"&gt;
          &lt;transport clientCredentialType="None" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/webHttpBinding&gt;
  &lt;/bindings&gt;
  &lt;/system.serviceModel&gt;
  &lt;startup&gt;
  &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;
  &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Here is my C# Code on the service interface:</p>
  
  <pre><code> [ServiceContract]
   public interface IService
   {
      [OperationContract]
      [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "Get/{Code}")]
      Stream Get(string Code);
  
  }
  </code></pre>
  
  <p>Method code</p>
  
  <pre><code>public class Service : IService
  {
  
      public Stream Get(string Code)
      {
          string strOutPut = "";
          WebOperationContext.Current.OutgoingResponse.ContentType = "application/json;charset=utf8";
          try
          {
              /// geting data
              return new MemoryStream(Encoding.UTF8.GetBytes(strOutPut));
          }
          catch (Exception e)
          {
             // error handler
          }
      }
  }
  </code></pre>
  
  <p>Any Ideas?  What am I missing to enable this method on HTTPS as a SharePoint ISAPI hosted service?</p>