I am implementing a distributed processing system where clients send requests with parameters being one list of objects(serialized) and another double value. to the server and server responds back with a list of objects as a result. I implemented the server and client parts.
Client part:
BasicHttpBinding myBinding = new BasicHttpBinding();
myBinding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;
myBinding.MaxBufferSize = Int32.MaxValue;
myBinding.MaxReceivedMessageSize = Int32.MaxValue;
myBinding.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
var myEndPoint = new EndpointAddress("http://172.20.54.168:6525/ServerObject");
var myChannelFactory = new ChannelFactory<MarchingCubesInterface>(myBinding, myEndPoint);
MarchingCubesInterface mc = null;
mc = myChannelFactory.CreateChannel();
and on server side
BasicHttpBinding serviceBind = new BasicHttpBinding();
serviceBind.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;
serviceBind.MaxBufferSize = Int32.MaxValue;
serviceBind.MaxReceivedMessageSize = Int32.MaxValue;
serviceBind.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
host.Description.Behaviors.Add(smb);
The objects are getting serialized but if i try to send a serialized list of more than 4 elements, it says The maximum string content length exceeded while reading XML data. I am implementing this purely on code-only base(no configuration files separately). Any ideas where I am making a mistake?