共享主机上的WCF服务(此集合已包含带有方案http的地址。)

时间:2011-10-18 02:04:25

标签: wcf shared-hosting

尝试调用WCF服务时,收到以下错误:

This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. 
Parameter name: item
Goog告诉我解决方案如下(当使用.net 3.5时,我是):

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

但是,当我尝试将其添加到我的web.config部分时,它告诉我它无效。

1 个答案:

答案 0 :(得分:0)

你应该在3.5中使用它:

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

如果你移动到4.0,你可以使用svc less激活,如下所示: ServiceRoute + WebServiceHostFactory kills WSDL generation? How to create extensionless WCF service with ?wsdl