在IIS上通过WCF服务启用HTTPS

在IIS上通过WCF服务启用HTTPS,wcf,web-services,ssl,https,web-config,Wcf,Web Services,Ssl,Https,Web Config,在stack overflow中再次问这个问题似乎很愚蠢,因为关于这个主题已经有足够多的帖子了…但是我可以看到每个帖子都有自己的实现方法…因此我的配置文件在下面指定…我已经跟踪了所有相关帖子并编写了这个Web配置文件…但是经过所有努力,我也在下面得到了这个错误: “找不到与绑定BasicHttpBinding的端点的方案https匹配的基址。注册的基址方案为[http]。” 这是我的Web.config文件 <?xml version="1.0"?> <configuratio

在stack overflow中再次问这个问题似乎很愚蠢,因为关于这个主题已经有足够多的帖子了…但是我可以看到每个帖子都有自己的实现方法…因此我的配置文件在下面指定…我已经跟踪了所有相关帖子并编写了这个Web配置文件…但是经过所有努力,我也在下面得到了这个错误:

“找不到与绑定BasicHttpBinding的端点的方案https匹配的基址。注册的基址方案为[http]。”

这是我的Web.config文件

<?xml version="1.0"?>
<configuration>

    <system.web>
        <compilation debug="true" targetFramework="4.0" />
      <globalization requestEncoding="utf-8" uiCulture="en" culture="en-US" responseEncoding="utf-8"/>
    </system.web>
    <system.serviceModel>
        <services>
            <service name="WcfService.Service1" behaviorConfiguration="ReqServiceBehaviour">
                <endpoint address ="" binding="webHttpBinding" contract="WcfService.IService1" behaviorConfiguration="web"/>
                <endpoint address="files" behaviorConfiguration="web" binding="webHttpBinding"
                                bindingConfiguration="httpStreamingBinding" name="UploadEndpoint"
                                contract="WcfService.IService1" />
                <endpoint address="" binding="basicHttpBinding" bindingConfiguration="secureHttpBinding" contract="WcfService.IService1"/>

                <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
            </service>
        </services>

        <bindings>
            <webHttpBinding>
                <binding name="httpStreamingBinding" transferMode="Streamed" />
            </webHttpBinding>
            <basicHttpBinding>
                <binding name="secureHttpBinding">
                    <security mode="Transport">
                        <transport clientCredentialType="None"/>
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>

        <behaviors>
            <serviceBehaviors>
                <behavior name="ReqServiceBehaviour">
                    <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
                    <serviceMetadata httpGetEnabled="true" />
                    <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                    <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
            </serviceBehaviors>
            <endpointBehaviors>
                <behavior name="web">
                    <webHttp/>
                </behavior>

            </endpointBehaviors>

        </behaviors>

        <protocolMapping>

            <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>
        <serviceHostingEnvironment  multipleSiteBindingsEnabled="true" />
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
        <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
        <directoryBrowse enabled="true"/>
    </system.webServer>

</configuration>

可能是您可以尝试以下内容

为了使用https,您需要设置httpsGetEnabled=“true”而不是httpGetEnabled=“true”

任何关于解决此错误和通过WCF启用https的帮助都将不胜感激!!!提前谢谢!!删除,回答不好,@praveengodfrey