The reason you are not receiving is NOT due to a timeout. I lost a week trying to figure it out.
I have links to silverlight, but this is not a Silverlight related issue.
An error not found exists due to the method of creating error codes. You need to catch any errors and change the error code - this will lead to the fact that errors will be reported properly and will not be disabled due to security.
If you think about it, the server was not found because the call is asynchronous and it died due to an exception in your code.
I use this class in my wcf service to connect - I do this through web.config, however it is not so difficult to change its wit ha class level attribute on the service itself.
you probably want to remove all materials from the contract. Its use in the project that I am working on, but is in no way related to this problem.
[AttributeUsage(AttributeTargets.Class)] public class FaultBehavior : Attribute, IServiceBehavior, IEndpointBehavior { public class SilverlightFaultMessageInspector : IDispatchMessageInspector { public void BeforeSendReply(ref Message reply, object correlationState) { Contract.Assume(reply !=null ); if (reply.IsFault) { HttpResponseMessageProperty property = new HttpResponseMessageProperty();
you need to determine the element that will be displayed in the web.config liek this file
public class FaultHandlerElement : BehaviorExtensionElement { protected override object CreateBehavior() { return new FaultBehavior(); } public override Type BehaviorType { get { return typeof(FaultBehavior); } } }
and then in the web configuration you need to add this to the service model section - the failure exception will have a wavy line below it;)
<system.serviceModel> <extensions> <behaviorExtensions> <add name="faultBehaviourExtension" type="CopSilverlight.Web.FaultHandlerElement, CopSilverlight.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/> </behaviorExtensions> </extensions
you then bind your behavior before use this way
<serviceBehaviors> <behavior name="basicHttpBehaviour"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> <faultBehaviourExtension /> </behavior>
An alternative โfixโ is to enable tracing in your wcf services. It should be noted that if you do not create a directory, it simply wonโt create a log
<system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true"> <listeners> <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\logs\appName\wcf.svclog" /> </listeners> </source> </sources> </system.diagnostics>
the recording is not perfect, although the first solution really fixes the problem.
I implemented both of them, and now I get exceptions bubbling up to my silverlight application, as you would expect.