title: How to consume webservices over https
body: <p>I am trying to consume a webservices which are located at <a href="https://TestServices/ServiceList.asmx" rel="nofollow noreferrer">https://TestServices/ServiceList.asmx</a>. When I try to add a service reference to my C# library class project my app.config file looks like below:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;system.serviceModel&gt;
          &lt;bindings&gt;
              &lt;basicHttpBinding&gt;
                  &lt;binding name="TestServicesSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
                      receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
                      bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                      maxBufferSize="50000000" maxBufferPoolSize="524288" maxReceivedMessageSize="50000000"
                      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="None"&gt;
                          &lt;transport clientCredentialType="None" proxyCredentialType="None"
                              realm=""&gt;
                          &lt;/transport&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="http://TestServices/ServiceList.asmx"
                  binding="basicHttpBinding" bindingConfiguration="TestServicesSoap"
                  contract="TestServices.TestServicesSoap" name="TestServicesSoap" /&gt;
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Even when I tried to add a service reference to the <strong><a href="https://TestServices/ServiceList.asmx" rel="nofollow noreferrer">https://TestServices/ServiceList.asmx</a></strong> for some reason end point address is still pointing to <strong><a href="http://TestServices/ServiceList.asmx" rel="nofollow noreferrer">http://TestServices/ServiceList.asmx</a></strong>. I tried changing the http to https but I am getting the below error:</p>
  
  <p><strong>The provided URI scheme 'https' is invalid; expected 'http'.
  Parameter name: via</strong> </p>
  
  <p>What is the right way of consuming the webservices on https?</p>