app.config
VB.NET
' Increase binding max sizes so that the image can be retrieved
If TypeOf pltSvr.Endpoint.Binding Is ServiceModel.BasicHttpBinding Then
Dim binding As ServiceModel.BasicHttpBinding = _
CType(pltSvr.Endpoint.Binding, ServiceModel.BasicHttpBinding)
Dim max As Integer = 5000000 ' around 5M size allowed
binding.MaxReceivedMessageSize = max
binding.MaxBufferSize = max
binding.ReaderQuotas.MaxArrayLength = max
End If
C#
// Increase binding max sizes so that the image can be retrieved
if (pltSvr.Endpoint.Binding is System.ServiceModel.BasicHttpBinding)
{
System.ServiceModel.BasicHttpBinding binding =
(System.ServiceModel.BasicHttpBinding)pltSvr.Endpoint.Binding;
int max = 5000000; // around 5M
binding.MaxReceivedMessageSize = max;
binding.MaxBufferSize = max;
binding.ReaderQuotas.MaxArrayLength = max;
}
3 comments:
Hi,
Nice informative post. Thanks.
Is there a way we can do this on server side (WCF service side) instead of client side?
This worked perfectly for me ... the config settings are cryptic so this was a great help.
This worked perfectly for me and was v helpful as the config settings are cryptic.
Post a Comment