This error can be caused by a number of things. While it was a timing issue in this case, it usually has nothing to do with timings, especially if the error is received immediately. Possible reasons are:
- The objects used as parameters or return types in your contract don't have parameterless constructors and are not decorated with the DataContract attribute. Check the classes used as parameters or return types, but also all the types used by the public properties of those classes. If you implement a constructor with parameters for one of those classes, the compiler will not add the default parameterless constructor for you anymore, so you will need to add that yourself.
- The default limits defined in service configuration are too low (MaxItemsInObjectGraph, MaxReceivedMessageSize, MaxBufferPoolSize, MaxBufferSize, MaxArrayLength).
- Some public properties of your DataContract objects are read-only. Make sure all public properties have both getters and setters.