Technology is not science. RSS Feed


Update maxBufferSize with maxReceivedMessageSize

I was working with a WCF service client application that failed. First, I had to modify the try-catch and using blocks. Then, I was able to see the real problem.

The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

This came as no surprise to me since it needed to send and receive large amounts of data. I updated my configuration file with a new binding to use 1MB instead of 64KB. (I was using a TCP binding.)

<bindings>
<
netTcpBinding>
<
binding name="myTcpBinding" maxReceivedMessageSize="1048576" />
</
netTcpBinding>
</
bindings>

I also updated the endpoint element in the service element by adding the bindingConfiguration attribute with the binding's name as its value. I performed both changes on the client and the server.

However, I still received exactly the same message because changing maxReceivedMessageSize wasn't enough. I also needed to update the maxBufferSize attribute of the same binding element.

<bindings>
<
netTcpBinding>
<
binding name="myTcpBinding" maxBufferSize="1048576" maxReceivedMessageSize="1048576" />
</
netTcpBinding>
</
bindings>
 
Posted by Chris Idzerda | 0 Comments | Trackback Url | Bookmark with:        
Tags: Work

Links to this Post

Comments

Name:
URL:
Email:
Comments:

CAPTCHA Image Validation