我有一个使用WCF服务与数据库通信的Silverlight 3.0应用程序,当我从服务方法返回大量数据时,我得到Service Not Found错误.我相信它的解决方案是简单地更新maxItemsInObjectGraph属性,但我以编程方式创建服务客户端,无法找到设置此属性的位置.这就是我现在正在做的事情:
BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None)
{
MaxReceivedMessageSize = int.MaxValue,
MaxBufferSize = int.MaxValue
};
MyService.MyServiceServiceClient client = new MyService.MyServiceProxyServiceClient(binding, new EndpointAddress(new Uri(Application.Current.Host.Source, "../MyService.svc")));
Run Code Online (Sandbox Code Playgroud)