2013-03-15 73 views
0

在堆棧溢出中再次提出此問題似乎很愚蠢,因爲本主題上已有足夠的帖子...但我可以看到每個帖子都有其自己的方式實現此目的。因此,我的這裏下面指定配置文件......我都遵循了所有相關的帖子,寫的所有努力後,該Web配置file..But也是我得到下面這個錯誤:通過IIS上的WCF服務啓用HTTPS

「找不到匹配的基址用於具有綁定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> 
+0

***任何幫助解決這個錯誤,並啓用WCF上的HTTPS被讚賞!感謝提前!! ***刪除,回答不好,@praveengodfrey – Kiquenet 2016-04-28 08:56:16

回答

0

可能是你可以嘗試以下

爲了使用https,你需要設置httpsGetEnabled = 「真」,而不是httpGetEnabled =「true」