Monday, May 14, 2007 6:34 AM
I'm tryng to send a large dataset with BasicHttpBinding. I didn't found were I change the max message size on my host, So I changed it on the client only. The problem is when i change the maxReceivedMessageSize the application run-over my new values and return the maxReceivedMessageSize to 65536.
Is it recommanded to change the maxRecievedMessageSize to a few megabytes?
Can I not restrict it at all?
Do I need to change something in my host?
Is there another recommanded solution?
Monday, May 14, 2007 10:38 PM
MaxReceivedMessageSize is a property of the endpoint (binding), not the host - so there's no place where you can set it for the all the services/endpoints in the host. When you set it in the binding, be it in the server or the client, this setting should be used - can you explain how the application is resetting maxReceivedMessageSize to 65536 after you set it in the client?
Regarding your questions:
1. If you expect the service to send/receive messages that are a few megabytes in size, then yes, you need to do that. Notice that this quota applies to incoming messages only - if your service is expected to receive large messages, then you need to increase the value of MaxReceivedMessageSize in the server; if the service is expected to send large messages (i.e., the client requests are small, but the responses are large), then you don't need to change it in the server, but you do need to increase it in the client.
2. You can set it to the maximum value, which is 2GB (2147483647) - or if you're using streamed transfers you can go up to 263 bytes (almost 10,000,000 terabytes). But remember that by setting it to a value larger than necessary you may be opening your service (or client) to attacks.
3. Only if the service is expected to receive messages larger than 65536 bytes. And in this case, you'd be increasing MaxReceivedMessageSize on the endpoints where you expect to receive such big messages.
4. No, if the messages that your client/servers expect to receive are larger than the default value for MaxReceivedMessageSize, then you need to increase this quota.
Thursday, May 17, 2007 10:36 AM
It works great, but when I re-build the project, the default values return.
Thursday, March 20, 2008 10:22 AM
I have two questions in this regard
Does increasing the message size decreases the performance by increasing the resources consuption.
Is there a way to dynamically setting this value based on the data size of the message.