Creating a copy of a message requires passing the "maximum buffer size" to CreateBufferedCopy. How big should I make this maximum buffer size?
In most cases, you can use Int.MaxValue and not worry about the buffer size. Specifying this buffer size is primarily useful when you haven’t previously given a bound to the maximum size of the message.
Note that whatever value you pass for the maximum buffer size, the default implementation of CreateBufferedCopy uses the maximum possible values for all of the XML reader quotas. It is just the total size of the message in bytes that is being bounded here.
Next time: Optional Interfaces on Binding Elements