i have client server app using net.tcp bindings with streamedResponse service, all WCF config has been defined in the app.config and all works fine with no problem, i had to remove the config from the client app and define them in code, nothing changed on the server, but the client seems to get the response as buffered instead of streamed with this transition, here is how i build the service in client code :
public static BuildChannelFactory()
{
channelFactorty = new ChannelFactory<IMyService>(GetStreamBinding(),
Address);
channelFactorty .Endpoint.Address = new EndpointAddress(
new Uri(Address), EndpointIdentity.CreateDnsIdentity(
"MyServer"));
channelFactorty.Credentials.ClientCertificate.SetCertificate(
StoreLocation.LocalMachine, StoreName.Root,
X509FindType.FindBySubjectName,
"MySubject");
channelFactorty.Credentials.ServiceCertificate.
Authentication.CertificateValidationMode =
System.ServiceModel.Security.X509CertificateValidationMode.Custom;
channelFactortyCredentials.ServiceCertificate.Authentication.
CustomCertificateValidator = MyCertificateValidator;
}
private static NetTcpBinding GetStreamBinding()
{
NetTcpBinding streamBinding = new NetTcpBinding
{
Name = "streamBinding",
ReceiveTimeout = new TimeSpan(2, 0, 0),
SendTimeout = new TimeSpan(0, 2, 0),
MaxBufferSize = int.MaxValue,
MaxReceivedMessageSize = int.MaxValue,
TransferMode = TransferMode.StreamedResponse,
ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas
{
MaxArrayLength = int.MaxValue,
MaxStringContentLength = int.MaxValue
}
};
streamBinding .Security.Mode = SecurityMode.Transport;
streamBinding .Security.Transport.ClientCredentialType =
TcpClientCredentialType.Certificate;
}
return streamBinding;
}