I want to be able to send large amount of data to my WCF service
, what i am sending is List<byte[]>
that the client received and currently my application get an error that socket aborted.
so i found ths thread: http://geekswithblogs.net/tmurphy/archive/2011/08/15/sending-large-arrays-with-wcf.aspx
this is how my connection is estanlished:
string urlService = "net.tcp://localhost:8000/myApp";
ServiceHost host = new ServiceHost(typeof(pp.classes.service1));
host.Opening += new EventHandler(host_Opening);
host.Opened += new EventHandler(host_Opened);
host.Closing += new EventHandler(host_Closing);
host.Closed += new EventHandler(host_Closed);
NetTcpBinding tcpBinding = new NetTcpBinding();
tcpBinding.TransactionFlow = false;
tcpBinding.Security.Transport.ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign;
tcpBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows;
tcpBinding.Security.Mode = SecurityMode.None; // <- Very crucial
pp.classes.service1 ser = new pp.classes.service1();
host.AddServiceEndpoint(typeof(pp.classes.IService1), tcpBinding, urlService);
ServiceMetadataBehavior metadataBehavior;
metadataBehavior = host.Description.Behaviors.Find<ServiceMetadataBehavior>();
if (metadataBehavior == null)
{
// Create the proxy object that is generated via the svcutil.exe tool
metadataBehavior = new ServiceMetadataBehavior();
metadataBehavior.HttpGetUrl = new Uri("http://localhost:8001/myApp");
metadataBehavior.HttpGetEnabled = true;
metadataBehavior.ToString();
host.Description.Behaviors.Add(metadataBehavior);
string urlMeta = metadataBehavior.HttpGetUrl.ToString();
}
host.Open();
I try to find maxReceivedMessageSize
, maxStringContentLength
and maxArrayLength
properties but i found only maxReceivedMessageSize
(i am working without app.config file)