views:

139

answers:

1

I have a WCF client/service with net.tcp transport. When I turn on the WCF tracing on client side I am seeing the following errors in trace (see screenshot from service trace viewer). The strange thing is that WCF is handling and recovering this error and my client doesn't receive any exception and it continues to work. This exception happens freqently, randomly but not on every web method call. The client (windows XP) authentication is windows, service is identified by SPN, services are self-hosted on windows service behind an NLB (windows server 2003). Can anyone explain me what is happening here.

The exception stacktrace from the trace xml is:

<ExceptionString>
System.ServiceModel.Security.MessageSecurityException: The server rejected the upgrade request. ---&gt; System.ServiceModel.ProtocolException: Error while reading message framing format at position 0 of stream (state: ReadingUpgradeRecord) ---&gt; System.IO.InvalidDataException: More data was expected, but EOF was reached.
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
</ExceptionString>

Screenshot:

A: 

Not sure what the real problem could be and if it's related to streaming (I'll dive in). Anyway you can try catch the exception on the server side and throw a CommunicationException instead.

catch (Exception ex)
{
    throw new CommunicationException(ex.Message, ex);
}

This way the client proxy should not ignore the exception and it's state should be "Faulted".

Luca Cestola