c# - Silverlight 应用程序的 WCF 服务返回 "NotFound"

标签 c# wcf silverlight web-config subsonic

我有一个 Silverlight 应用程序的 WCF Web 服务,它似乎不想工作。

非常简单;当我同时调试 silverlight 应用程序和 wcf 时,刚启动 WCF 就停止工作并抛出以下消息:

CommunicationException was unhandled by user code. The remote server returned an error: NotFound.

WCF 引用另一个名为 DAL 的代码库,它使用 SubSonic 并存储我正在使用的数据库文件。

这是我的 WCF web.config 文件。似乎有问题,因为其中没有端点,但我不完全确定。

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="Database" connectionString='Data Source=.\SQLEXPRESS;AttachDbFilename="[FILE LOCATION OF MDF FILE]";Integrated Security=True;User Instance=True' providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
  <modules runAllManagedModulesForAllRequests="true"/>
 </system.webServer>
</configuration>

如有任何帮助,我们将不胜感激。

谢谢

最佳答案

在调试此类问题时,我通常使用 Fiddler (http://fiddler2.com/fiddler2/) 来捕获来自 WCF 的实际响应,自从 SL 收到 NotFound 消息以来,这应该会为您提供有关该问题的更多详细信息隐藏实际的异常。

关于c# - Silverlight 应用程序的 WCF 服务返回 "NotFound",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9246211/

相关文章:

c# - 如何同时(并行)使用多个客户端调用 WCF webservice

c# - WCF NetTcpBinding 缓冲与流式性能问题

Silverlight在Firefox 3.6上有问题吗?

java - 具有良好音频支持的网络应用程序客户端框架

c# - 如何使用触发器?

c# - Wcf 休息服务 URL 最大长度

c# - 如何构建字符串以动态访问 .resx 资源

c# - 通过 TLS 发送 Emai 仍然 gmail 给出警告

c# - WCF 启用 Ajax-如何增加一个 [OperationContract] 的数据长度大小

c# - WPF 中的性能