title: Adding WCF Service Reference with https endpoint
body: <p>My WCF service application works over http and https, however, when I add a service reference (with the https url) to it in my client, Visual Studio 2010 sets the endpoint in the config file to http. It doesn't appear to be as simple as changing that config endpoint to https since there are multiple files behind the scenes doing things with the xsd's and reference the http endpoint. How can I setup my service / client to force https so that it correctly sets the endpoint?</p>
  
  <p>When I try to manually change the endpoint in the config file and set security mode to "Transport" I get this error:</p>
  
  <blockquote>
    <p>Exception Message: There was no endpoint listening at
    <a href="https://myservice/AvailabilityService.svc" rel="noreferrer">https://myservice/AvailabilityService.svc</a> that could accept the
    message. This is often caused by an incorrect address or SOAP action.
    See InnerException, if present, for more details.</p>
  </blockquote>
  
  <p>I can, however, see that endpoint in IE, and am debugging locally. After I add my service reference with https and search the solution for its http equivolent, it finds a wsdl file referencing http, a configuration.svcinfo, and a configuration91.svcinfo that utilizes the http url instead of https</p>
  
  <p>Here's my server side config:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0" /&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
    &lt;/system.serviceModel&gt;
   &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>.. And the client side config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="BasicHttpBinding_IAvailabilityService" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
            &lt;security mode="Transport"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" /&gt;
              &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="https://myservice/AvailabilityService.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAvailabilityService"
            contract="PaymentAvailabilityService.IAvailabilityService"
            name="BasicHttpBinding_IAvailabilityService" /&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Perhaps I'm better off manually consuming the services in code?</p>