I am currently trying to create a webservice in a winform application using WCF, WShttpBinding. One of the methods returns a dictionary. The client side, an RTD Server will call this method to retrieve the dictionary.
For some reason, when the dictionary gets too large( 0.6MB +), a communication exception will be thrown. I have tried increasing the size of the following parameters both on the clientside and serverside, but it still willnot work. Can someone tell me what I am doing wrong? Thanks.
binding.MaxReceivedMessageSize
binding.MaxBufferPoolSize
binding.SendTimeout
binding.OpenTimeout
binding.ReceiveTimeout
binding.ReaderQuotas.MaxStringContentLength
binding.ReaderQuotas.MaxDepth
binding.ReaderQuotas.MaxBytesPerRead
Add a
behaviorconfiguration in yourApp.configfiles:Note that
2147483647is the max value and maybe you don’t need that much.And don’t forget to reference the behavior in your services and endpoints: