Coder Perfect

The specified URI scheme ‘https’ is incorrect; the desired URI scheme is ‘http’. name of parameter: through


I’m trying to create a WCF service that can be used via https using basicHttpBinding. My web.config is as follows:

<!-- language: xml -->
<service behaviorConfiguration="MyServices.PingResultServiceBehavior"
    <endpoint address="" 
            <dns value="localhost" />
    <endpoint address="mex" 
              contract="IMetadataExchange" />
    <binding name="defaultBasicHttpBinding">
      <security mode="Transport">
        <transport clientCredentialType="None"/>
    <behavior name="MyServices.UpdateServiceBehavior">
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />

I am connecting using WCFStorm which is able to retrieve all the meta data properly, but when I call the actual method I get:

Asked by isg

Solution #1

Try adding the following credentials to your app.config:

<binding name="defaultBasicHttpBinding"> 
  <security mode="Transport"> 
    <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> 
    <message clientCredentialType="Certificate" algorithmSuite="Default" />

Answered by Jojo Sardez

Solution #2

Because you can’t do any sophisticated formatting in comments, I’m adding this as a response. I was having the identical problem, but I was writing my web service client fully in code. Reason is the DLL was being uploaded into a system, which prohibited the use of config files.

Here is the code as it needed to be updated to communicate over SSL…

Public Function GetWebserviceClient() As WebWorker.workerSoapClient
    Dim binding = New BasicHttpBinding()
    binding.Name = "WebWorkerSoap"
    binding.CloseTimeout = TimeSpan.FromMinutes(1)
    binding.OpenTimeout = TimeSpan.FromMinutes(1)
    binding.ReceiveTimeout = TimeSpan.FromMinutes(10)
    binding.SendTimeout = TimeSpan.FromMinutes(1)

    binding.Security.Mode = BasicHttpSecurityMode.Transport

    Dim endpoint = New EndpointAddress("https://myurl/worker.asmx")

    Return New WebWorker.workerSoapClient(binding, endpoint)
End Function

Answered by eidylon

Solution #3

Change from

<security mode="None">


<security mode="Transport">

in the file web.config You will be able to utilize https instead of http as a result of this change.

Answered by Amir Md Amiruzzaman

Solution #4

Are you using Cassini (as opposed to a development server) or IIS with a certificate installed? In the past, I’ve had trouble connecting secure endpoints to the dev web server.

This is the binding arrangement that has previously worked for me. It uses wsHttpBinding instead of basicHttpBinding. I’m not sure if that’s an issue for you.

<!-- Binding settings for HTTPS endpoint -->
<binding name="WsSecured">
    <security mode="Transport">
        <transport clientCredentialType="None" />
        <message clientCredentialType="None"
            establishSecurityContext="false" />

and the endpoint

<endpoint address="..." binding="wsHttpBinding"
    bindingConfiguration="WsSecured" contract="IYourContract" />

Also, ensure that Transport security is enabled in the client settings.

Answered by pattersonc

Solution #5

In a custom binding case, I had the same issue. Anyone who uses this method can double-check this.

I was actually referencing a service from a local WSDL file when I did this. It was successfully inserted, and the necessary custom binding was added to the config file. The real service, however, was https rather than http. As a result, I replaced the httpTransport element with httpsTransport. This resolved the issue.


    <binding name="MyBindingConfig">

      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
        messageVersion="Soap11" writeEncoding="utf-8">
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
          maxBytesPerRead="4096" maxNameTableCharCount="16384" />

      <!--Manually changed httpTransport to httpsTransport-->
      <httpsTransport manualAddressing="false" maxBufferPoolSize="524288"
        maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
        decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
        keepAliveEnabled="true" maxBufferSize="65536" 
        realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
        useDefaultWebProxy="true" />


  <endpoint address=""
    binding="customBinding" bindingConfiguration="MyBindingConfig"
    contract="HRTest.TestWebserviceManagerImpl" name="TestWebserviceManagerImpl" />



Answered by LCJ

Post is based on