Wednesday, March 24, 2010

WCF: Error in deserializing body of reply message

Problem

You got an error "Error in deserializing body of reply message" when calling WCF service.

Solution

If your response message size is huge then check the reader quota settings in client app/web.config-file at bindings section and change them. For example:

<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>

Note that you must have same binding, which settings you are changing, in server side also!

More about reader quota: http://msdn.microsoft.com/en-us/library/ms731325.aspx

No comments:

Post a Comment