SL + WCF 报:远程服务器返回了错误: NotFound

用户代码未处理 System.ServiceModel.CommunicationException
远程服务器返回了错误: NotFound。

 

在ServiceBehaviors中添加maxItemsInObjectGraph属性

<dataContractSerializer maxItemsInObjectGraph="2147483647"/>

 

其次在客户端在调用WCF服务的时候要添加

using System.Net.Browser;

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

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

 

 

posted @ 2011-01-09 13:10  luckdv  阅读(2164)  评论(3)    收藏  举报