【问题标题】:Error With service endpoint in wcf https ssl. Cannot find base address that matches scheme http for the end point with binding WebHttpBindingwcf https ssl 中的服务端点出错。找不到与具有绑定 WebHttpBinding 的端点的方案 http 匹配的基地址
【发布时间】:2012-11-15 17:16:55
【问题描述】:

我的服务器中有以下代码

<services>
  <service name="ME.Streets.WebGateway.DuplexService.DuplexService"
     behaviorConfiguration="sb">
    ....
    <endpoint
        address=""
        binding="webHttpBinding"
        behaviorConfiguration="webHttpEndpointBehavior"
        contract="ME.Streets.WebGateway.DuplexService.Interface.IPolicyRetriever"/>
     ....
    <host>
    <baseAddresses>
      <add baseAddress="https://localhost:10201" />
    </baseAddresses>
    </host>
  </service>

我一直在使用 SSL 和 WCF 将 silverlight 应用程序切换到 HTTPS,但是如果我运行我的服务器,我收到以下错误

- System.InvalidOperationException: Could not find a base address that matches
 scheme http for the endpoint with binding WebHttpBinding. Registered base address     
 schemes are [https].

我非常不确定这个错误是从哪里来的。我是否必须在&lt;service&gt; 节点内安装 https &lt;baseaddress&gt; 节点?

【问题讨论】:

  • 您使用的是自签名证书吗?
  • 我确实是!它被称为本地主机

标签: c# wcf silverlight ssl https


【解决方案1】:

已修复!

将端点更改为此(添加 bindingConfiguration="webHttpsBinding"):

<services> .....
        <endpoint
            address=""
            binding="webHttpBinding"
            behaviorConfiguration="webHttpEndpointBehavior"
            bindingConfiguration="webHttpsBinding"
            contract="ME.Streets.WebGateway.DuplexService.Interface.IPolicyRetriever">
        </endpoint>
......
</services>

而新的绑定配置如下:

<bindings>....
    <webHttpBinding>
    <binding name="webHttpsBinding">
        <security mode="Transport">
            <transport clientCredentialType="None" />
        </security>
    </binding>
</webHttpBinding>
......
</bindings>

这为端点提供了一个与 http 绑定的绑定,该绑定指定了传输信息的路径以及连接用户必须拥有的凭据类型

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-06
    • 2021-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-31
    相关资源
    最近更新 更多