Intercepting WCF calls in thick clients that uses nettcpbinding? is it possible and how?

StackOverflow https://stackoverflow.com/questions/20884042

  •  23-09-2022
  •  | 
  •  

Frage

Considering the following scenario,

I have a thick client that communicate with server through (Windows communication foundation) WCF using nettcpbinding.

Is there any way to intercept the traffic and/or alter it.

War es hilfreich?

Lösung

The simplest way to intercept the WCF soap messages for debugging on either the client or service is to turn on the built-in WCF tracing feature. You can configure it to only log soap messages by only adding the <source name="System.ServiceModel.MessageLogging"> element.

If you want programmatic access to the soap message then you can implement the IClientMessageInspector behavior in your client application. This blog post on message inspectors describes how you would implement and configure the IClientMessageInspector.

I don't have an experience doing low-level inspection of TCP packets but you can look at the free WireShark tool to work with TCP packets.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top