I set up my SDL Tridion 2011 instance to run with multiple host headers and now the Core Service doesn't work. How do I fix it?

旧街凉风 提交于 2019-12-23 08:51:34

问题


I recently configured my SDL Tridion 2011 CME to use multiple host headers. To enable the CME to load I set WCF.RedirectTo in the appropriate web.config. However, my Core Service no longer works. I get the following error:

WebHost failed to process a request. Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/63835064 Exception: System.ServiceModel.ServiceActivationException: The service '/webservices/CoreService.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item. ---> System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.

How do I fix this?


回答1:


You can enabled the multiple site bindings by editing the web.config for the Tridion UI and the Core Service:

  • Open the web.config in [Tridion Install Folder]\web\WebUI\WebRoot\
  • Find the serviceHostingEnvironment section Add a new attribute to that node for multipleSiteBindingsEnabled="true"
  • This should then look like <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
  • Save the file
  • Open the web.config in [Tridion Install Folder]\webservices\
  • Find the serviceHostingEnvironment section
  • Add a new attribute to that node for multipleSiteBindingsEnabled="true" This should then look like <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
  • Save the file

If you don't want to enable it for all URL's you can enable it for specific ones like:

<system.serviceModel>  
    <serviceHostingEnvironment>  
        <baseAddressPrefixFilters>  
            <add prefix="http://test1.tridion.com"/>  
            <add prefix="http://test2.tridion.com"/>  
        </baseAddressPrefixFilters>  
    </serviceHostingEnvironment>  
</system.serviceModel>


来源:https://stackoverflow.com/questions/9428360/i-set-up-my-sdl-tridion-2011-instance-to-run-with-multiple-host-headers-and-now

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!