Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
On my website, I have a silverlight app that utilizes a WCF service. Normally, everything works fine however if I leave the page inactive for a little while, and then click one of the buttons, I get the following error:
System.ServiceModel.CommunicationException: The remote server returned an error: Not Found
Here's the code where my error's occuring (the error occurs on the 2nd line of code within the method(the line that contains "_result = ((MyApp.MyAppService....." ) :

<br />
public MyApp.MyAppService.AccountSilverlight EndGetAccount(System.IAsyncResult result) <br />
{<br />
object[] _args = new object[0];<br />
MyApp.MyAppService.AccountSilverlight _result = ((MyApp.MyAppService.AccountSilverlight)(base.EndInvoke("GetAccount", _args, result)));<br />
                return _result;<br />
}<br />


Any idea why this may be happening?

Thanks.
Posted
Updated 13-Jul-16 2:12am

Hi,

With silverlight its a very common error, firstly the error u r getting is a generic error which silverlight application shows for any service side error.
Now the solution, try the find out the root cause of this error.
There are various ways of doing this.
Below is the one which i used for mine:
1) Add the below piece of code to ur config file of the wcf service
XML
<system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="traceListener"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData= "D:\Sumit.svclog"/>
        </listeners>
      </source>
    </sources>
  </system.diagnostics>


this will generate an .svc, analyse this file it will provide you with a lot of information.

2) U can use external tools for analysing the wcf service calls, such as fiddler. In this case also try to analyse the service calls
 
Share this answer
 
add this into your config file

HTML
<system.servicemodel>
    <client>
      <endpoint address="ENDPOINT Address">
        (other stuff)
      </endpoint></client></system.servicemodel>
 
Share this answer
 
v2
Comments
Nelek 4-Jan-14 6:21am    
1) If you post code, then use the proper tags, specially if it contains HTML. Otherwise it won't be displayed properly
2) Do you realize that the questions is over 3 years old, and it was answered and solved?
This error may arise if the service and client binding are different or in case of dynamic binding suppose you are creating a service with
wshttpbinding and on client you are using basicHttpBinding as it is default. Then this kind of errror may arise. So please check both the
binding are same or not.
 
Share this answer
 
Comments
Richard Deeming 13-Jul-16 8:27am    
This question was asked, answered, and solved nearly SIX YEARS AGO!

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900