开发者

Strange WCF net.tcp exception

I have a WCF client/service with net.tcp transport. When I turn开发者_StackOverflow 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>

Strange WCF net.tcp exception

:


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".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜