Silverlight 应用程序的 WCF 服务返回“NotFound”
我有一个用于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在调试此类问题时,我通常使用 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.