我有一個WCF服務託管在IIS(7.0)中,該服務實現了多個服務契約,因此定義了多個端點(每個契約一個)。它一直工作正常,但我剛剛添加了一個https綁定到IIS Web應用程序,現在我得到一個激活異常,指定該服務實現多個合同,但實際上沒有在配置中定義端點。我發現this文章解決了由於向IIS添加主機名而導致的類似問題,但它似乎沒有幫助我的情況。在添加https綁定後,IIS中的Restful WCF(webhttpbinding)會中斷
這裏是我的配置的片段是相關的:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://localhost/CDC.WebPortal.MidTierAccessService/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<services>
<service name="CDC.WebPortal.MidTier.MidTierAccessService"
behaviorConfiguration="MidTierServiceBehaviour" >
<endpoint address="http://localhost/CDC.WebPortal.MidTierAccessService/MidTierAccessService.svc"
binding="webHttpBinding" bindingName="RestBindingConfiguration"
contract="CDC.WebPortal.ServiceContract.IProductService"/>
<endpoint address="http://localhost/CDC.WebPortal.MidTierAccessService/MidTierAccessService.svc/Category" binding="webHttpBinding"
bindingName="RestBindingConfiguration"
contract="CDC.WebPortal.ServiceContract.ICategoryService"/>
<endpoint address="http://localhost/CDC.WebPortal.MidTierAccessService/MidTierAccessService.svc/Account" binding="webHttpBinding"
bindingName="RestBindingConfiguration"
contract="CDC.WebPortal.ServiceContract.IAccountService"/>
<endpoint address="http://localhost/CDC.WebPortal.MidTierAccessService/MidTierAccessService.svc/Order"
binding="webHttpBinding" bindingName="RestBindingConfiguration"
contract="CDC.WebPortal.ServiceContract.IOrderService"/>
<endpoint address="http://localhost/CDC.WebPortal.MidTierAccessService/MidTierAccessService.svc/mex"
binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
任何建議表示讚賞。
我不使用HTTPS的服務實際上,我加入https綁定到iis Web應用程序以運行其他站點。我意識到我可以創建另一個Web應用程序,而無需使用https綁定來爲服務使用,但是我想知道爲什麼此問題出現了,並且可以修復。 – 2009-11-30 01:13:08