简体   繁体   English

我的 WCF 服务 SL4 应用程序出现通信异常

[英]Communication Exception with my WCF Service SL4 app

Sorry if the Title is a little vague but the truth is I do not understand my problem, I have never come across this before and I havent done anything out of the Ordinary.对不起,如果标题有点含糊,但事实是我不明白我的问题,我以前从未遇到过这个,我也没有做过任何不寻常的事情。

Right I have a basic Silverlight 4 Application using the Business Application Template.对 我有一个基本的 Silverlight 4 使用业务应用程序模板的应用程序。 I have also created a WCF Service Application Project which is used to simply return an Observable collection for some entries in my Database,我还创建了一个 WCF 服务应用程序项目,用于简单地为我的数据库中的某些条目返回一个 Observable 集合,

I published this to my Local computer which I then referenced in my SL4 app and I get this exception我将其发布到我的本地计算机,然后在我的 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)}

I have got a clientaccess policy and crossdomain policy which for the purpose of testing is set to allow anything access,我有一个客户端访问策略和跨域策略,出于测试目的设置为允许任何访问,

Client Access Policy客户端访问策略

Cross Domain跨域

any ideas on how to fix this problem, I debugged my WCF Service and it receives the call, the method executed reaches its return statement, yet my SL4 never even receives the result, as soon as my WCF service has the result I get an exception thrown within my SL4 app, to me it just seems that the connection gets closed but I dont know and I have tried to research but where do you start with something you dont fully understand?关于如何解决这个问题的任何想法,我调试了我的 WCF 服务并且它接收到调用,执行的方法到达它的返回语句,但是我的 SL4 甚至从未收到结果,一旦我的 WCF 服务有结果我得到一个异常扔在我的 SL4 应用程序中,对我来说似乎连接已关闭但我不知道并且我已经尝试研究但是你从哪里开始你不完全理解的东西? I found many people with the same sort of error message but WCF is so damn cryptic... I did try and enable the debugging information inside of my webconfig.我发现很多人都有同样的错误消息,但是 WCF 太他妈神秘了……我确实尝试在我的 webconfig 中启用调试信息。 I have also tried to host the WCF service on my Web server but no luck, I have several WCF Services running on that with a similar set up so I am unsure why this isnt working我还尝试在我的 Web 服务器上托管 WCF 服务,但没有运气,我有几个 WCF 服务在其上运行,设置类似,所以我不确定为什么这不起作用

Web Config for WCF Service Web 配置 WCF 服务

client config客户端配置

Thanks for having a look, and if you need any more info just ask I'll be happy to provide you with it,感谢您的浏览,如果您需要更多信息,请询问我很乐意为您提供,

Your best bet is to turn on WCF Tracing so you can see what is going on.最好的办法是打开 WCF 跟踪,这样您就可以看到发生了什么。

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

Most likely there is an issue with serializing something.序列化某些东西很可能存在问题。 Not found is just the Silverlight version of a 500 error.未找到只是 Silverlight 版本的 500 错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM