【问题标题】:Communication Exception with my WCF Service SL4 app我的 WCF 服务 SL4 应用程序出现通信异常
【发布时间】:2012-04-05 22:43:09
【问题描述】:

对不起,如果标题有点模糊,但事实是我不明白我的问题,我以前从未遇到过这个问题,我也没有做过任何不寻常的事情。

好的,我有一个使用业务应用程序模板的基本 Silverlight 4 应用程序。我还创建了一个 WCF 服务应用程序项目,用于简单地为我的数据库中的某些条目返回一个 Observable 集合,

我将此发布到我的本地计算机,然后在我的 SL4 应用程序中引用它,我得到了这个异常

[System.ServiceModel.CommunicationException: The remote server returned an error:     NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. --->     System.Net.WebException: The remote server returned an error: NotFound.
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult  asyncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.  <EndGetResponse>b__4(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState)
--- End of inner exception stack trace ---
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object  state)
at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at  System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.  CompleteGetResponse(IAsyncResult result)
--- End of inner exception stack trace ---
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs,  IAsyncResult result)
at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[]  args, IAsyncResult result)
at  RMServiceRIA.rService.Service1Client.Service1ClientChannel.EndgetBuildings(IAsyncResult  result)
at  RMServiceRIA.rService.Service1Client.RMServiceRIA.rService.IService1.EndgetBuildings(IAsync Result result)
at RMServiceRIA.rService.Service1Client.OnEndgetBuildings(IAsyncResult result)
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)}

我有一个客户端访问策略和跨域策略,出于测试目的设置为允许任何访问,

Client Access Policy

Cross Domain

关于如何解决这个问题的任何想法,我调试了我的 WCF 服务并且它接收到调用,执行的方法到达它的返回语句,但是我的 SL4 甚至从未收到结果,只要我的 WCF 服务有结果我在我的 SL4 应用程序中引发异常,对我来说,似乎连接已关闭,但我不知道,我已尝试研究,但你从哪里开始你不完全理解的东西?我发现很多人都有相同类型的错误消息,但 WCF 太神秘了……我确实尝试在我的 webconfig 中启用调试信息。我也尝试在我的 Web 服务器上托管 WCF 服务,但没有运气,我有几个 WCF 服务运行在类似的设置上,所以我不确定为什么这不起作用

Web Config for WCF Service

client config

感谢您的浏览,如果您需要更多信息,请联系我们,我们很乐意为您提供,

【问题讨论】:

  • 原来问题是通过Tracing解决的,我学到了一些新东西,所以以后我不会再遇到这个问题了!

标签: c# wcf silverlight


【解决方案1】:

最好的办法是打开 WCF 跟踪,这样您就可以看到正在发生的事情。

http://software.intel.com/en-us/blogs/2010/02/03/adventures-with-silverlight-and-wcf-the-remote-server-returned-an-error-notfound/

序列化很可能存在问题。 Not found 只是 Silverlight 版本的 500 错误。

【讨论】:

  • 感谢 Bryant 问题在于我的 DataContext 被处理但在稍后阶段访问,仍在尝试解决该问题,但幸运的是我知道在哪里寻找答案
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-11
  • 1970-01-01
  • 2011-03-26
  • 1970-01-01
  • 1970-01-01
  • 2013-06-07
相关资源
最近更新 更多