WCF错误.找不到与具有绑定WSHttpBinding的终结点的方案http匹配的基地址

本文关键字:结点 方案 基地址 http WSHttpBinding 找不到 错误 绑定 WCF | 更新日期: 2023-09-27 18:00:31

我是构建Web服务和WCF的新手,尽管到目前为止我做得很好,但我遇到了以下问题,我似乎无法解决。

找不到与具有绑定WSHttpBinding的终结点的方案http匹配的基地址。已注册的基本地址方案为[]。

我已将app.config设置为这样的

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.web>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
      <system.serviceModel>
        <bindings>
          <wsHttpBinding>
            <binding name="WcfSoapServiceBinding">
              <security mode="None" />
            </binding>
          </wsHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="WcfSoapServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service behaviorConfiguration="WcfSoapServiceBehavior" name="WcfSoapService.Service1">
            <endpoint binding="wsHttpBinding" bindingConfiguration="WcfSoapServiceBinding"
              contract="WcfSoapService.IService1" />
          </service>
        </services>
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
    </configuration>

我将安全模式设置为"无",因此它使用HTTP而不是HTTPS,并且我还将httpGetEnabled设置为true。一段时间以来,我在网上尝试了一些不同的选择,但到目前为止都没有帮助。我正在使用Ewald Hofman关于如何使用WCF订阅TFS的示例。

http://www.ewaldhofman.nl/post/2010/08/02/How-to-use-WCF-to-subscribe-to-the-TFS-2010-Event-Service-rolling-up-hours.aspx

我觉得我很接近,但这是我无法克服的一件事。我的最终目标是从TFS获取Soap请求并解析其数据。作为WCF和Web服务器的新手,我不确定这个错误到底告诉我什么是错误的。所以我有两个问题。

1) 这个错误意味着什么是错误的?更具体地说,"注册的基本地址方案是[]"是什么意思。

2) 我该如何着手解决这个错误?

WCF错误.找不到与具有绑定WSHttpBinding的终结点的方案http匹配的基地址

在您的服务部分中为端点添加基本地址或添加地址元素。

 <services>
          <service behaviorConfiguration="WcfSoapServiceBehavior" name="WcfSoapService.Service1">
         <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8182/MyService"/>
          </baseAddresses>
        </host>
            <endpoint address=""
 binding="wsHttpBinding" bindingConfiguration="WcfSoapServiceBinding"
              contract="WcfSoapService.IService1" />
          </service>