【问题标题】:WCF - Could not find a base address that matches scheme http for the https endpointWCF - 找不到与 https 端点的方案 http 匹配的基地址
【发布时间】:2013-12-30 11:31:27
【问题描述】:

当我尝试运行我的服务时,我收到以下错误: “找不到与绑定 BasicHttpBinding 的端点的方案 http 匹配的基地址。注册的基地址方案是 [https]。”

我的服务声明:

 <service name="service" behaviorConfiguration="serviceEndpointBehavior">

    <host>
      <baseAddresses>
        <add baseAddress="https://abc:12704/service"/>
      </baseAddresses>
    </host>

    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding2" contract="service"/>
    <endpoint address="mex" contract="IMetadataExchange" binding="basicHttpBinding"/>

  </service>

绑定:

  <basicHttpBinding>
    <binding name="basicHttpBinding2" maxReceivedMessageSize="1000000">
      <readerQuotas maxArrayLength="1000000" maxStringContentLength="1000000"/>
    </binding>
  </basicHttpBinding>

我在行为上也有以下声明:

<behavior name="serviceEndpointBehavior">
      <dataContractSerializer maxItemsInObjectGraph="1000000"/>
      <serviceMetadata httpsGetEnabled="true" />
</behavior>

有什么想法吗?

【问题讨论】:

  • 你能在任何浏览器上浏览https://abc:12704/service吗?
  • 是的,我可以。我的 wsdl 看起来很棒。
  • 尝试在 web.config 中将安全模式从“Transport”更改为“none
  • 不幸的是还是一样;/

标签: .net wcf service


【解决方案1】:

您定义的绑定是一个基本的 http 绑定。您的端点是具有附加安全性 (https) 的 http。您需要在绑定上定义安全性,否则它们将不匹配。如果没有任何安全性,您就不能拥有 https。

您需要找到一个很好的教程或书籍,因为 https 比配置文件中的几个条目更多。您将需要一个证书,并且您将需要一个实际执行此操作的 Web 服务器(提示:Cassini,内置 VS 网络服务器不会执行任何 https ......它会简单地删除它而不给出任何警告)。

【讨论】:

  • 我为基本的 http 绑定添加了安全性: 但仍然没有。
猜你喜欢
  • 2013-11-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-29
  • 1970-01-01
  • 2010-09-26
  • 2012-04-06
相关资源
最近更新 更多