R – WCF exception – “Service not found” when retrieving large collection

silverlightwcfweb-services

my WCF service it's used by a Silverlight application to retrieve data. I've no problem,

    [OperationContract]
MyCollectionClass GetList(int sessID, string name);

  [CollectionDataContract]
public class MyCollectionClass : List<MyClass>{ }

  [DataContract]
public class MyClass {

  [DataMember]
  public string Prop1 { get; set; }

  [DataMember]
  public string Prop2 { get; set; }

}

But.. when MyCollectionClass have a less then 3000+ "record" it works. When the number of records is greater the WCF service seems to work, but on the completed event of the Silverlight app an exception occurs: "Service Not Found".
I've found that could be related to service configuration and i've tryied to use both:

maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"

on WCF and Client configuration. Also added:

readerQuotas: 
  maxArrayLength="2000000" 
  maxStringContentLength="2000000"/>

(also changed the values found) But seems to not working.
I think that the problem is that the message exceed the max number of byte per "message", but I do not understand why data is not spanned on different message.
Any tips is appreciated.

Giorgio

Best Solution

I had the same problem, in my case was just serializing an string and no prob there, BUT in your case you are serializing a big bunch of objects, there's a default limit for that, I remember I saw a post about that (just a setting in the config --> maxItemsInObjectGraph) to high up that number of serialized objects,

Links

http://silverlight.net/forums/t/17674.aspx http://forums.asp.net/t/1330713.aspx

Settings:

HTH Braulio