【发布时间】:2010-12-21 11:52:02
【问题描述】:
我有一个托管在 IIS (7.0) 中的 WCF 服务,它实现了多个服务合同,因此定义了多个端点(每个合同一个端点)。它一直工作正常,但我刚刚向 IIS Web 应用程序添加了一个 https 绑定,现在我得到一个激活异常,指定该服务实现了多个合同,但实际上没有在配置中定义端点。我发现 this 文章解决了向 IIS 添加主机名引起的类似问题,但它似乎对我的情况没有帮助。
这是我的相关配置的 sn-p:
<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>
欢迎提出任何建议。
【问题讨论】: