Logging WCF Custom Binding Client Messages

Published on the 29th of September 2009

Ever wanted to trace / log a WCF client message when using a custom binding? Well I faced this dilemma and found a "good enough" solution.

When tracing or logging a WCF client one can use build in features. However, when you are using a 'custom binding' implementation this is isn't (always) possible.

You are basically depending upon the implementation of the binding. In my case it lacked the ability to trace or log messages.

In order to see what was being send I first tried Fiddler but that didn't work since the custom adapter seemed to ignore any proxy configuration I threw at it.

My solution then was to use Wireshark (kudos to Johan de Vries). A freeware application that logs all activity on your LAN card. Simply run the program and watch out for messages that are send. Copying the message can be done by 'right clicking' the data bit, and select 'copy bytes as text'.