4

I am looked all over the internet and all over stack overflow to fix this problem and nothing has worked I hope someone has an idea what I am missing.

I am trying to connect to an https: service but I am getting this error

"The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via"

This is my config:

<system.serviceModel>
<client>
  <endpoint address="https://authenicate.example.com/service/authenticate" behaviorConfiguration="Project" binding="basicHttpBinding" bindingConfiguration="SSLBinding" contract="Example.Test.Authentication" name="InternalAuthenticate" />
</client>
<bindings>
  <basicHttpBinding>
    <binding name="SSLBinding" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="Transport" />
      <readerQuotas maxDepth="32" maxStringContentLength="2048000" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" />
    </binding>
  </basicHttpBinding>
</bindings>
<services />
<behaviors>
  <endpointBehaviors>
    <behavior name="Project">
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="DispatcherBehavior">
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

Any Ideas?

cmarfia
  • 43
  • 1
  • 1
  • 3

2 Answers2

3

You can use Mex binding instead for HTTPS. As mentioned in the comments there are alternatives that don't require the use of Mex binding. Take a look at this example.

TheCodeKing
  • 19,064
  • 3
  • 47
  • 70
  • This is incorrect. I am able to use HTTPS with BasicHttpBinding. I did have a problem with it, including needing to eliminate the mex endpoing, but... [Stackoverflow to the rescue](http://stackoverflow.com/questions/11512969/wcf-on-https-generates-the-provided-uri-scheme-https-is-invalid-expected-ht) – ALEXintlsos Jul 18 '12 at 13:57
  • 2
    This is truly incorrect. Setting the security mode as Transport will use HTTPS as expected. See the MSDN documentation at http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpsecuritymode.aspx for more details. – allu Aug 21 '12 at 06:29
0

Or use a custom binding.

  <customBinding>
    <binding name="CustomHttpBinding">
      <security allowInsecureTransport="True">
      </security>
      <httpTransport />
    </binding>
  </customBinding>

I've had to do this to get arround some problems using WCF and a load balancer

DazManCat
  • 3,540
  • 5
  • 30
  • 33