【问题标题】:Http and Https request to WCF service对 WCF 服务的 Http 和 Https 请求
【发布时间】:2011-07-14 09:24:03
【问题描述】:

在system.service / behaviours / servicebehaviours

我有以下行为:

<behavior name="pubajaxAspNetAjaxBehavior">
  <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"  />
  <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

有了 httpGetEnabled="true" 和 httpsGetEnabled="true" 这两个属性,这意味着现在通过 http 对我的网络服务的任何请求都会引发错误:

找不到与方案 https 匹配的基地址 具有绑定 WebHttpBinding 的端点。注册的基地址方案 是 [http]。

是否可以有一个接受 http 和 https 请求的 WCF 服务?

【问题讨论】:

    标签: asp.net wcf


    【解决方案1】:

    我不认为你可以在同一个端点上同时使用它们,但是你可以为不同的端点使用不同的绑定。

    您可以为此使用绑定

    <bindings>
          <basicHttpBinding>
            <binding name="HttpBinding">
              <security mode="None">
                <transport clientCredentialType="None"></transport>
              </security>
            </binding>
            <binding name="HttpsBinding">
              <security mode="Transport">
                  <transport clientCredentialType="Windows" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
    

    请看那个帖子

    Stackoverflow post

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-15
      • 1970-01-01
      • 1970-01-01
      • 2016-06-03
      • 2015-10-15
      • 2012-12-18
      相关资源
      最近更新 更多