远程服务器返回错误

远程服务器返回错误

本文介绍了WCF错误:远程服务器返回错误:未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站上,我有一个使用WCF服务的silverlight应用程序。通常,一切正常,但是如果我让页面处于非活动状态一段时间,然后单击其中一个按钮,我会收到以下错误:

System.ServiceModel.CommunicationException:远程服务器返回了错误:未找到

这是我的错误发生的代码(错误发生在方法中的第二行代码中(包含_result =((MyApp.MyAppService .....) ):



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.

推荐答案

<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>





这将生成.svc,分析它将提供的文件你有很多信息。



2)你可以使用外部工具来分析wcf服务调用,比如fiddler。在这种情况下,还尝试分析服务调用



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


<system.servicemodel>
    <client>
      <endpoint address="ENDPOINT Address">
        (other stuff)
      </endpoint></client></system.servicemodel>



这篇关于WCF错误:远程服务器返回错误:未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 14:29