【问题标题】:"The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via" - Help?“提供的 URI 方案 'https' 无效;应为 'http'。参数名称:通过” - 帮助?
【发布时间】:2011-11-22 07:04:42
【问题描述】:

我在整个互联网上都查看过堆栈溢出来解决这个问题,但没有任何效果我希望有人知道我错过了什么。

我正在尝试连接到 https: 服务,但出现此错误

"提供的 URI 方案 'https' 无效;应为 'http'。参数名称:via"

这是我的配置:

<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>

有什么想法吗?

【问题讨论】:

    标签: asp.net web-services http https web


    【解决方案1】:

    您可以使用 Mex 绑定代替 HTTPS。如 cmets 中所述,有一些替代方案不需要使用 Mex 绑定。看看this example

    【讨论】:

    • 这是不正确的。我可以将 HTTPS 与 BasicHttpBinding 一起使用。我确实遇到了问题,包括需要消除 mex endpoing,但是...Stackoverflow to the rescue
    • 这确实不正确。将安全模式设置为传输将按预期使用 HTTPS。有关详细信息,请参阅msdn.microsoft.com/en-us/library/… 的 MSDN 文档。
    【解决方案2】:

    或者使用自定义绑定。

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

    我不得不这样做以解决使用 WCF 和负载平衡器的一些问题

    【讨论】:

      猜你喜欢
      • 2015-11-19
      • 2012-02-19
      • 1970-01-01
      • 1970-01-01
      • 2011-01-27
      • 1970-01-01
      • 2021-11-03
      • 1970-01-01
      • 2010-12-14
      相关资源
      最近更新 更多