2016-10-03 99 views
0

我跑啓用無SSL服務器上的我的WCF服務,現在我把它移到一個啓用SSL,我收到以下錯誤:移動WCF服務IIS6啓用SSL

Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https].

下面是我的設置:

<bindings> 
    <basicHttpBinding> 
    <binding name="basicHTTP"> 
     <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Windows"> 
     </transport> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 
<services> 
    <service behaviorConfiguration="basicBehavior" name="ProjectName.MyService"> 
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHTTP" contract="ProjectName.IMyService"/> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="basicBehavior"> 
     <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> 
     <serviceDebug includeExceptionDetailInFaults="true"/> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 

我該如何解決這個錯誤?

回答

0

修正了指定安全模式Transport和使用的WebHttpBinding

0

您需要定義basicHttps綁定。這是一個非常簡單的設置,對SSL的工作原理:

<system.serviceModel> 
    <bindings> 
     <basicHttpsBinding> 
     <binding name="BasicHttpBinding_IMyService" /> 
     </basicHttpsBinding> 
    </bindings> 

    <client> 
     <endpoint 
     name="BasicHttpBinding_IMyService" 
     address="https://MyURL/MyService.svc/soap/" 
     binding="basicHttpsBinding" 
     bindingConfiguration="BasicHttpBinding_IMyService" 
     contract="ClientServiceReference.IMyService" /> 
    </client> 

    </system.serviceModel> 

注:端點需要定義其網址是HTTPS

同時,確保在生產環境中,你是不是發送異常的詳細信息返回給調用者(這將被認爲是在您的系統安全漏洞,因爲異常可能透露太多的信息給黑客)。你必須改變這一行:

<serviceDebug includeExceptionDetailInFaults="false"/> 
+0

我已經基本綁定上述 – ElenaDBA

+0

定義的問題,即定義你的終點? – Sparrow

+0

查看我在原始問題中發佈的web.config文件 – ElenaDBA