您的位置:首页 > 其它

SilverLight调用WCF”远程服务器返回了错误: NotFound”的排解

2010-02-02 10:30 344 查看
远程服务器返回了错误: NotFound,该错误一般为WCF调用不成功,SL的错误类型是CommunicationException,但是具体的错误类型及信息不完整,通过以下方法,可以使错误信息更加完成。

在WCF服务的类中加上

[ServiceBehavior(IncludeExceptionDetailInFaults = true)]

然后在调用此服务的silverlight的初始化方法中加上:


bool registerResult = WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);


bool httpsResult = WebRequest.RegisterPrefix("https://", WebRequestCreator.ClientHttp);

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: