【发布时间】:2015-06-30 23:33:22
【问题描述】:
总的来说,我是构建 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 的示例。
我觉得我很接近,但这是我无法克服的一件事。我的最终目标是从 TFS 获取 Soap 请求并解析其数据。作为 WCF 和 Web 服务器的新手,我不确定这个错误实际上告诉我什么也是错误的。所以我有两个问题。
1) 这个错误是什么意思是错误的?更具体地说,“注册的基地址方案是 []”是什么意思。
2) 我该如何解决这个错误?
【问题讨论】:
-
您没有为端点指定地址 - 您是在 IIS 中托管服务还是自托管?
标签: c# web-services wcf tfs wshttpbinding