![](/img/trans.png)
[英]Unable to configure WCF service for net.tcp in IIS hosting multiple sites
[英]WCF HTTPS and multiple sites in IIS
我正在嘗試將IIS配置為在兩個IIS網站中托管一組二進制文件。 因此,我們希望能夠訪問這些URL:
將internal.example.com和external.example.com設置為不同的IIS站點,以允許我們為它們分配不同的應用程序池。 但是,當我將HTTPS支持添加到我們的web.config中時,內部HTTP支持停止了工作。 http://internal.example.com/ADataService現在返回錯誤:
找不到與具有綁定CustomBinding的端點的方案https匹配的基地址。 注冊的基址方案為[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托管在不同的應用程序池中,我認為它們將具有進程隔離功能嗎?
似乎將HTTPS證書添加到“ internal.example.com”的網站可以解決此問題。 注意:如果沒有此證書,我們將無法通過HTTP或HTTPS訪問internal.example.com,並且使用這兩種證書都可以正常工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.