WCF service for Silverlight application returns “NotFound”
-
28-04-2021 - |
Frage
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
Lösung
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.