problem serializing a dataset

problem serializing a dataset

Old forum URL: forums.lhotka.net/forums/t/6608.aspx


kyle.l.watson@gmail.com posted on Friday, March 13, 2009

I was trying to use a dataset for some flat data with your framework but have been receiving this error:

 

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter https://ws.lhotoka.net/wcfdataportal:request. the maximium bytes per read operation quote (4096) has been exeeeded while reading xml data. This quote may be increased by changing the Maxbytesperread property on the xmldictionaryreaderquotas object used when creating the xml reader.

Is there a way to correct this?

RockfordLhotka replied on Saturday, March 14, 2009

The exception gives a pretty good indication of the issue. WCF has default limits on the size of data than can be transferred, and you've hit one of those limits. You need to change the WCF configuration as indicated, to raise the limits.

There are other posts on this topic in the forum (this is a fairly common thing), and of course any decent WCF book and much online WCF content should also be helpful.

Configuring WCF usually just involves adding a bunch of XML to the system.serviceModel elements of your client and server config files. The options for WCF are incredibly flexible, and include a great many max size, timeout and other values.

kyle.l.watson@gmail.com replied on Monday, March 16, 2009

You're absolutely right.

In my case, you can set the readerquotas under the binding section on the client. The attribute "maxbytesperread" was adjusted in my case.

 

Copyright (c) Marimer LLC