views:

277

answers:

0

I'm implementing a nettcp streaming channel in order to pull down large files from my server to a WPF client app. I made a change to the client config reader quotas in order to facilitate the size of the files but am experiencing an issue when changing the MaxBytesPerRead setting on the client. From what I understand this controls the amount of data per read from the client so I wanted to turn it up a bit in order to maybe receive the file a bit faster. While trying to turn this value up it throws the following error:

{"The 'maximum bytes per Read operation' quota (8192) has been exceeded while reading XML data. Long element start tags (consisting of the element name, attribute names and attribute values) may trigger this quota. This quota may be increased by changing the MaxBytesPerRead property on the XmlDictionaryReaderQuotas object used when creating the XML reader."}

My client binding config looks like this:

<binding name="netTcpStreamed" maxReceivedMessageSize="52428800" maxBufferSize="8192" transferMode="Streamed" receiveTimeout="00:10:00">
    <readerQuotas maxBytesPerRead="8192"/>
    <security mode="Transport">
         <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
         <message clientCredentialType="Windows" />
    </security>

The host binding config looks like this:

<binding name="netTcpStreamed" receiveTimeout="00:01:00" sendTimeout="00:10:00" transferMode="StreamedResponse">
   <security mode="Transport">
        <transport clientCredentialType="Windows"/>
   </security>

I'm thinking there is probably a config setting in the host binding that I'm missing but I can't find one in any of the WCF documentation that I've read. My answer thus far has been to leave the defaults and everything seems to work which is fine but out of complete curiosity (and probably lack of understanding) I was wondering if anyone could give me an idea as to why this may be happening.

Thanks