How can I set the maxItemsInObjectGraph property programmatically from a Silverlight Application?

Posted by Corey Sunwold on Stack Overflow See other posts from Stack Overflow or by Corey Sunwold
Published on 2010-03-18T21:59:20Z Indexed on 2010/03/18 22:01 UTC
Read the original article Hit count: 690

Filed under:
|

I have a Silverlight 3.0 application that is using a WCF service to communicate with the database, and when I have large amounts of data being returned from the service methods I get Service Not Found errors. I am fairly confident that the solution to it is to simply update the maxItemsInObjectGraph property, but I am creating the service client progrogrammatically and cannot find where to set this property. Here is what I am doing right now:

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")));

© Stack Overflow or respective owner

Related posts about wcf-client

Related posts about Silverlight