2013-01-25 77 views
0

我試圖將IIS配置爲在兩個IIS網站中託管一組二進制文件。因此,我們希望能夠訪問網址:WCF HTTPS和IIS中的多個站點

internal.example.com和external.example.com被設置爲不同的IIS站點讓我們爲他們分配不同的應用程序池。但是,當我向web.config添加HTTPS支持時,內部HTTP支持停止工作; http://internal.example.com/ADataService現在返回錯誤:

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

這是我們的web.config

<system.serviceModel> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
    <bindings> 
     <customBinding> 
     <binding name="jsonCustomMapper"> 
      <webMessageEncoding webContentTypeMapperType="Service.JSONCustomMapper, Service" /> 
      <httpTransport manualAddressing="true" /> 
     </binding> 
     <binding name="httpsjsonCustomMapper"> 
      <webMessageEncoding webContentTypeMapperType="Service.JSONCustomMapper, Service" /> 
      <httpsTransport manualAddressing="true" /> 
     </binding> 
     </customBinding> 
    </bindings> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="jsonBehavior"> 
      <webHttp /> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior name="defaultBehavior"> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <services> 
     <service name="Service.Service" behaviorConfiguration="defaultBehavior"> 
     <endpoint address="json" binding="customBinding" bindingConfiguration="jsonCustomMapper" behaviorConfiguration="jsonBehavior" contract="Service.IJSONService" /> 
    <endpoint address="json" binding="customBinding" bindingConfiguration="httpsjsonCustomMapper" behaviorConfiguration="jsonBehavior" contract="Service.IJSONService" /> 
     </service> 
    </services> 
    </system.serviceModel> 

的細節從我的理解multipleSiteBindingsEnabled="true"和HTTPS不要混用,但我不知道他們會什麼資源分享?如果我們在不同應用程序池中託管了internal.example.com和external.example.com,我認爲他們會進行隔離?

回答

0

似乎向網站「internal.example.com」添加HTTPS證書可以解決問題。注意:如果沒有此證書,我們無法通過HTTP或HTTPS訪問internal.example.com,證書兩種機制都可以正常工作。