Silverlight 应用程序的 WCF 服务返回“NotFound”

发布于 2025-01-05 10:18:54 字数 1703 浏览 2 评论 0原文

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

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

CommunicationException 未被用户代码处理。 远程服务器返回错误: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>

任何帮助将不胜感激。

谢谢

I have a WCF web service for a silverlight application that doesn't seem to want to work.

Pretty straight forward; when I debug the silverlight application and wcf at the same time, just after launching the WCF stops working and throws the following message:

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

The WCF references another code library named DAL which uses SubSonic and stores a database file I'm working with.

Here is my WCF web.config file. There seems to be something wrong because there's no endpoints in it but I'm not entirely sure.

<?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>

Any help would be much appreciated.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡写薰衣草的香 2025-01-12 10:18:54

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

In debugging this type of problem I typically use Fiddler (http://fiddler2.com/fiddler2/) to capture the actual response from WCF, which should give you much more detail about the problem since the NotFound message that SL gets hides the actual exception.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文