简体   繁体   English

Silverlight和WCF:NotFound错误!

[英]Silverlight and WCF: NotFound error!

I have WCF method like so: 我有这样的WCF方法:

    public string GetSomething(MyObject obj)
    {
        return "Something";
    }

When I call this from my silverlight app I get an error: 当我从我的silverlight应用程序调用它时,我收到一个错误:
System.Net.WebException: The remote server returned an error: NotFound..... System.Net.WebException:远程服务器返回错误:NotFound .....

I call the method from my silverlight app like so: 我从我的silverlight应用程序调用方法如下:

        mProxy.GetSomethingAsync(new MyObject());

Now, when I call the method like this it works fine: 现在,当我调用这样的方法时,它工作正常:

        mProxy.GetSomethingAsync(null);

So there seems to be some problem with passing in a complex object. 因此传递复杂对象似乎存在一些问题。

Note that I return this MyObject from other method and it works fine so it's not a serializable issue. 请注意,我从其他方法返回此MyObject,它工作正常,因此它不是一个可序列化的问题。 I also changed the maxBufferSize and maxReceivedMessageSize to the max value so it's not that, and i pass in an empty object anyway so it shouldn't be a size issue. 我还将maxBufferSize和maxReceivedMessageSize更改为最大值,所以不是这样,我传入一个空对象,所以它不应该是一个大小问题。 And MyObject only contains simple datatypes. 而MyObject只包含简单的数据类型。

Has anyone any suggestions? 有人有什么建议吗?

That "Not Found" error is perhaps the single most annoying feature of Silverlight WCF access. “未找到”错误可能是Silverlight WCF访问中最令人讨厌的功能。

You may want to look into the Service Trace Viewer Tool ( here ). 您可能需要查看服务跟踪查看器工具( 此处 )。 It's not always helpful (I've run into lots of problems that it wasn't able to help with), but about 10-20% of the time, it'll point me in the right direction. 它并不总是有用(我遇到了很多无法帮助的问题),但是大约有10-20%的时间,它会指向正确的方向。

You may also want to try adding the SilverlightFaultBehavior to your service. 您可能还想尝试将SilverlightFaultBehavior添加到您的服务中。 It can turn at least some of those "Not Found" error messages into real faults. 它可以将至少一些“未找到”错误消息转换为真正的错误。

I have used the WcfTestClient.exe to debug my WCF services. 我使用WcfTestClient.exe来调试我的WCF服务。 It gives a much more user friendly error message. 它提供了更加用户友好的错误消息。 If you want to set up Silverlight to receieve WCF faults, I found this page on Data Performance and Fault Strategies in Silverlight 3 to be helpful. 如果您想设置Silverlight以接收WCF故障,我发现Silverlight 3中的数据性能和故障策略页面很有帮助。

( http://msdn.microsoft.com/en-us/magazine/ee294456.aspx ) http://msdn.microsoft.com/en-us/magazine/ee294456.aspx

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

相关问题 远程服务器返回错误:NotFound。 Silverlight + WCF - The remote server returned an error: NotFound. Silverlight + WCF Silverlight WCF抛出远程服务器返回错误:NotFound - Silverlight WCF throwing The remote server returned an error: NotFound 远程服务器返回错误:NotFound WCF服务 - The remote server returned an error: NotFound WCF Service 将Collection发送到WCF时,远程服务器返回错误:NotFound - The remote server returned an error: NotFound, when sending a Collection to WCF 在Silverlight项目中更新WCF服务参考时出错 - Error updating WCF service reference in silverlight project 使用Silverlight的WCF wsHttpBinding中的跨域错误 - Cross domain error in WCF wsHttpBindingwith silverlight 部署的WCF Silverlight应用程序返回404错误 - Deployed WCF Silverlight application returns 404 Error WCF服务引用调用返回“远程服务器返回错误:NotFound。” - WCF Service Reference call returning “The remote server returned an error: NotFound.” 执行服务方法后的WCF。 System.ServiceModel.CommunicationException:远程服务器返回错误:NotFound - WCF after executing service method. System.ServiceModel.CommunicationException: The remote server returned an error: NotFound WebRequest奇怪的NotFound错误 - WebRequest Strange NotFound Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM