tags:

views:

33

answers:

1

I can successfully use WCF streaming to xfer data from a server to client on the same machine. However as soon as I deploy my server to another machine, I get errors of the nature "A call to SSPI failed: The target principal name is incorrect". Has anyone come across this. I tried to set SecurotyMode.None on both sides but that gave me some other timeout errors !

Here is the server binding :

NetTcpBinding binding = new NetTcpBinding();
binding.TransferMode = TransferMode.Streamed;
binding.MaxReceivedMessageSize = int.MaxValue;
binding.CloseTimeout = TimeSpan.MaxValue;
binding.SendTimeout = TimeSpan.MaxValue;
var ep = serviceHost.AddServiceEndpoint( typeof( ISessionResultsServer ), binding, string.Format( "net.tcp://localhost:{0}/ResultService", port ) ); 

Here is the client binding :

NetTcpBinding clientBinding = new NetTcpBinding();
clientBinding.TransferMode = TransferMode.Streamed;
clientBinding.SendTimeout = TimeSpan.MaxValue;
clientBinding.CloseTimeout = TimeSpan.MaxValue;
clientBinding.MaxReceivedMessageSize = long.MaxValue;
clientBinding.ReceiveTimeout = TimeSpan.MaxValue;
A: 

This has nothing to do with streaming. It is security problem. You are using Net TCP with Windows security where service has to authenticate to the client and client has to authenticate to the service.

Service authentication in your case is based on User Principal Name. It is a user name of the process hosting your service. You have to modify client configuration and set correct identity in the endpoint.

Something like:

<client>
  <endpoint name="..." addres="net.tcp://..." binding="netTcpBinding" bindingConfiguration="..." contract="...">
    <identity>
      <userPrincipalName value="MyServiceAccount@MyDomain" />
    </identity>
  </endpoint>
</client> 
Ladislav Mrnka
Agree this has nothing to do with streaming. With my security mode set as described above and the SendTimeout changed from MaxValue to 20 mins, the call worked.
nilesh shah