11

I'm fooling around with WCF, and would like to see how many messages I send/receive, and how large these messages are.

I tried activated WCF tracing, and ended up with a real huge trace file, but I found no way to extract the simple message size from this.

There sure must be some way to get this? Maybe I missed some parameters in tracing?

Sam
  • 28,421
  • 49
  • 167
  • 247

3 Answers3

5

Besides using something like Wireshark (nee ethereal) you could look at something like Fiddler which has other benefits as well. It shows content length for all request/response and allows you to view the content in several ways.

denis phillips
  • 12,550
  • 5
  • 33
  • 47
  • posted ages ago but I'd like to add fiddler could do this without changing your app.config/web.config to add logging etc. Run fiddler, call the WCF method, finally, check the size of the document on fiddler's inspector tab -> response Web view tab (or headers but just in case the wrong byte size was sent). – Bahamut Oct 25 '12 at 11:51
3

The WCF Service Trace Viewer tool allows you to open the huge trace file and analyze many aspects of your messages. Make sure you've also turned on message logging, so the messages themselves get logged too (with properties such as size...)

JacobE
  • 8,021
  • 7
  • 40
  • 48
  • 8
    Hi Jacob, can you be a bit more specific? I've turned on full message logging. Still couldn't find the message size anywhere. – Krishna Apr 05 '10 at 11:41
  • 3
    I have also checked trace viewer and I dont see an option for MessageSize – Signcodeindie Sep 07 '11 at 16:15
  • 1
    I don't see message size in the trace logs either even when viewing it with the Service Trace Viewer, this didn't answer the question – Scott Lerch Oct 18 '14 at 19:06
-1

you could also build interceptors in WCF and capture and log this information on your own.

http://msdn.microsoft.com/en-us/library/ms751495.aspx

Derik Whittaker
  • 832
  • 1
  • 7
  • 10