【问题标题】:WCF Test client not loading the ServiceWCF 测试客户端未加载服务
【发布时间】:2011-08-26 17:10:29
【问题描述】:

最近我开发了一个 wcf 服务。 直到昨天它工作正常。我能够测试它 在内置的 WCF 测试客户端中使用 VS2010。 从昨天开始,我无法在 WCF 测试客户端中看到我的服务。 当我按 F5 时,它会打开 Wcf 测试客户端窗口并在底部 它显示服务添加成功。但它不加载任何服务。 我试图从文件/添加服务手动添加它,但它仍然没有加载。 可能是什么问题呢。 我真的很感谢你的帮助。 这是我的 Web.config。


<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    <bindings/>
    <client/>
    <services>
      <service behaviorConfiguration="myproj.ServiceBehavior" name="myproj.Service">
        <endpoint address="" binding="webHttpBinding" contract="myproj.IService" behaviorConfiguration="REST">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="REST">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="myproj.ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

【问题讨论】:

    标签: wcf c#-4.0


    【解决方案1】:

    您将 webHttpBinding 用于 REST 样式的 WCF 服务。

    WCF 测试客户端是一个 SOAP 测试应用程序 - 它适用于 SOAP Web 服务(基本上除了 WCF 中的webHttpBinding 之外的任何东西。

    对于 REST 服务,只需浏览到服务 URL 并以这种方式调用您的 REST 服务。

    【讨论】:

    • 谢谢,但有什么方法可以为 REST 应用程序调用测试客户端?
    • @SreekanthKarumanaghat:对于 REST,你需要使用另一个工具——比如Fiddler。 WCF 测试客户端适用于 REST
    • @marc_s.. 我是 .NET 的新手 使用 wcf 服务应用程序在 IIS 中托管服务器是否有任何问题,如果是的话是什么?使用 wcf 服务库有什么好处吗? WCF 服务库如何通过按 F5 在 Cassini 中工作,但我不能直接将其托管在 IIS 中,考虑到 Cassini 用于在 IIS 中使用之前进行测试的事实,为什么会发生这种情况?请给我一些关于这方面的见解。
    • 你能给我你的电子邮件ID吗?
    • 那么我该如何阻止此服务在 WCF 测试客户端中自动打开?
    猜你喜欢
    • 2019-10-27
    • 1970-01-01
    • 2013-07-05
    • 1970-01-01
    • 1970-01-01
    • 2011-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多