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;
}