I'm having problems with the WCF service. The return type is a semi-complex type that refers to the various base types and the base interface that each of these types inherits from.
In my debugging, the total byte size of the serialized message is under the default threshold of 65535 bytes. However, I increased the maxReceivedMessageSize attribute to 1,000,000, and the problem remains.
The WCF service is defined as follows:
[ServiceContract] public interface ILoggingService { [OperationContract] NotesInfo ListNotes(NotesQueryOptions options); }
Here is the definition for the returned NotesInfo object:
[DataContract] public class NotesInfo { [DataMember] public List<TokenizedNote> Notes { get; set; } [DataMember] public Dictionary<long, User> Users { get; set; } [DataMember] public Dictionary<long, NoteCategory> NoteCategories { get; set; } [DataMember] public Dictionary<string, Dictionary<long, IIdentifiable<long>>> EntitiesByToken { get; set; } }
When I try to call a service, I get the following exception:
The server did not provide a meaningful response; this may be caused by non-compliance with the contract, premature session termination or internal server error. Description: An unhandled exception occurred during the execution of the current web request. Look at the stack trace for error information and it came from the code.
Exception Details: System.ServiceModel.CommunicationException: The server did not provide a meaningful response; this may be caused by non-compliance with the contract, premature session termination or internal server error.
Source Error:
Line 242: Line 243: public AxeFrog.Mobile.NotesInfo ListNotes(AxeFrog.Mobile.NotesQueryOptions options) { Line 244: return base.Channel.ListNotes(options); Line 245: } Line 246: }
Source file: C: \ Users \ Nathan \ Work \ Internal Projects \ AxeFrog System \ Source \ Trunk \ AxeFrog.Mobile.WebInterface \ Service Links \ LoggingServiceReference \ Reference.cs Line: 244
Below is the code for the other objects involved:
public interface IIdentifiable<TID> { TID ID { get; set; } } [DataContract] public class Note : IIdentifiable<long> { [DataMember] public long ID { get; set; } [DataMember] public DateTime DateStamp { get; set; } [DataMember] public long? UserID { get; set; } [DataMember] public long NoteCategoryID { get; set; } [DataMember] public NoteType NoteType { get; set; } [DataMember] public string Message { get; set; } } public enum NoteType { Information = 0, Warning = 10, Failure = 20 } [DataContract] public class NoteCategory : IIdentifiable<long> { [DataMember] public long ID { get; set; } [DataMember] public string Name { get; set; } } [DataContract] public class NoteEntityType : IIdentifiable<long> { [DataMember] public long ID { get; set; } [DataMember] public Type TypeName { get; set; } } [DataContract] public class TokenizedNote { [DataMember] public Note Note { get; set; } [DataMember] public List<NoteSegment> NoteSegments { get; set; } } public abstract class NoteSegment { public abstract string Render(INoteRenderer renderer, Dictionary<string, Dictionary<long, IIdentifiable<long>>> entitiesByToken); } [DataContract] public class NoteTextSegment : NoteSegment { [DataMember] public string Text { get; set; } } [DataContract] public class NoteEntitySegment : NoteSegment { [DataMember] public long EntityID { get; set; } [DataMember] public string Token { get; set; } }
Note that I removed the Render () overrides from the abstract NoteSegment implementations for readability.
Here is some info from thedebugger so you can see what is coming back:


Any understanding of what I might be doing wrong would be appreciated. A Google search provides few answers to useful answers.