Click here to Skip to main content
15,888,014 members
Articles / Silverlight
Tip/Trick

System.Net.WebException [HttpWebRequest_WebException_RemoteServer]

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
13 Jun 2013CPOL1 min read 22.8K   1  
Frequent error using WCF in Silverlight.

Introduction 

We get this error: "System.Net.WebException The remote server returned an error: Not Found", sometimes while using Silverlight. It's sometimes a nightmare to resolve the error. We can follow small steps to resolve it. 

Background  

Normally, If the service encounters an error while you are calling a method the Silverlight app will get a not found error. 

Using the code 

  1. Using a tool like fiddler is very helpful in finding a problem with a service call.
  2. The "Not Found" error is a generic response to a CommunicationsException that may occur due to an exception that occurs within the service call itself.

While Fiddler is a good tool for examining the requests/responses as well as the resources loaded, your best bet is to enable WCF tracing and use the WCF log viewer.

Under "Tools..." in Visual Studio, use the "WCF Service Configuration Editor". Open the application configuration file for the service that you are testing and under the diagnostics node, you can choose to enable tracing and the logging of messages. (Warning, these files can get very large, so remove them after debugging sessions or make sure that you disable when your debugging is done.)

There is a WCF log viewer that is part of the Platform SDK. After running your application which is calling the service and you receive the error in your application, there will be a "*.svclog" file in the same directory in which your service is running. You can double click on this file (if already associated with the viewer) and you can view all the details of the service calls, messages, responses, etc.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --