错误“没有协议绑定与给定地址匹配……”

问题描述 投票:8回答:3

我在IIS服务器中托管了2个WCF服务。

这里是web.config

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="HttpBinding" />
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="BShop.Services.BubensService">
        <endpoint address="http://localhost:9001/BubensService" binding="basicHttpBinding"
          bindingConfiguration="HttpBinding" name="" contract="BShop.Services.IBubensService" />
      </service>
      <service name="BShop.Services.OrdersService">
        <endpoint address="http://localhost:9001/OrdersService" binding="basicHttpBinding"
          bindingConfiguration="HttpBinding" contract="BShop.Services.IOrdersService" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

[当我尝试运行它时,我得到了

没有协议绑定与给定 地址 “ http:// localhost:9001 / BubensService”。 协议绑定在以下位置配置 IIS或WAS中的站点级别 配置。

我在配置中错过了什么?

.net wcf
3个回答
24
投票

0
投票

0
投票
© www.soinside.com 2019 - 2024. All rights reserved.