WCF Services on shared hosting (This collection already contains an address with scheme http.)

杀马特。学长 韩版系。学妹 提交于 2019-12-25 03:58:09

问题


When trying to call a WCF service I receive the following error:

This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. 
Parameter name: item

The Goog tells me that the solution is as follows (when using .net 3.5, which I am):

  <baseAddressPrefixFilters> 
    <add prefix="http://mydomain.com.au"/> 
  </baseAddressPrefixFilters> 

However, when I try to add this to the section of my web.config it tells me it is invalid.


回答1:


You should use this instead in 3.5:

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>

if you move to 4.0 you can use svc less activation as shown here: ServiceRoute + WebServiceHostFactory kills WSDL generation? How to create extensionless WCF service with ?wsdl



来源:https://stackoverflow.com/questions/7801674/wcf-services-on-shared-hosting-this-collection-already-contains-an-address-with

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