繁体   English   中英

为WCF服务启用HTTPS流量。 将流量http更改为https的问题

[英]Enable HTTPS traffic for WCF Service. Issue with changing traffic http to https

问题是:我尝试将WCF服务流量从HTTP更改为HTTPS。 但我无法访问此服务,我收到404错误。 我看到一些博客说我们需要添加自定义绑定。 但我没有得到。

请在这件事上给予我帮助。 下面是我的默认HTTP绑定的Web配置。

我希望将其更改为HTTPS。

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior>
          <webHttp helpEnabled="True" />
        </behavior>
      </endpointBehaviors>
    </behaviors>

    <protocolMapping>
      <add binding="webHttpBinding" scheme="http" />

    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <directoryBrowse enabled="true" />
    <httpProtocol>
    </httpProtocol>
  </system.webServer>

我在<behaviors>标记下面添加了以下代码,并像冠军一样工作。

<bindings>
        <webHttpBinding>
            <binding>
                <security mode="Transport" />
                </binding>
        </webHttpBinding>
    </bindings>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM