我試圖將IIS配置爲在兩個IIS網站中託管一組二進制文件。因此,我們希望能夠訪問網址:WCF HTTPS和IIS中的多個站點
- http://external.example.com/ADataService
- https://external.example.com/ADataService
- http://internal.example.com/ADataService
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,我認爲他們會進行隔離?