View Single Post
Old 03-06-2008   #2 (permalink)
Philippe Requilé


 
 

Re: Too large WCF response (Compact framework)

This was the error:
"The maximum size quota for incoming messages (65536) has been exceeded"

Solution :
increase MaxReceivedMessageSize (default=65536):

endpointAddress = new EndpointAddress("http://xxx/yyy/Svc.svc");
System.ServiceModel.Channels.CustomBinding binding = new
System.ServiceModel.Channels.CustomBinding();
System.ServiceModel.Channels.TextMessageEncodingBindingElement
textMessageEncodingBindingElement
= new
System.ServiceModel.Channels.TextMessageEncodingBindingElement(System.ServiceModel.Channels.MessageVersion.Soap11,
System.Text.Encoding.UTF8);
binding.Elements.Add(textMessageEncodingBindingElement);

System.ServiceModel.Channels.HttpTransportBindingElement
httpBindingEl
= new
System.ServiceModel.Channels.HttpTransportBindingElement();
httpBindingEl.MaxReceivedMessageSize = 65536 * 10;
binding.Elements.Add(httpBindingEl);

svcClientInstance = new OPSSvcClient(binding, endpointAddress);


My System SpecsSystem Spec