Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top