views:

158

answers:

2

I have a WCF service defined, it accepts JSON and maps that JSON to an object at which point I can then begin debugging code.

Sometimes, the object fails to create. Most recently my service had a BodyStyle of Wrapped but should have been Bare. In this case I would have liked to watch the request come in and see what happens to it as it gets mapped from JSON to POCO and then onto the service so I can watch for errors.

I'd also like to see what happends with the response where I have also had issues in the past.

What is the best way of seeing what is going on in WCF when it is (kind of) out of my control? What kind of logging/tracing can I use and can I see errors/exceptions being thrown by WCF?

Thanks Scott

+3  A: 

I don't know much but svctraceviewer might help in case you haven't heard about it already.

Arnis L.
I have heard of it but have never been able to get it going. I try every now and then but nothing seems to happen. It could be my dev machine not playing nicely; it's a hand-me-down.
objektivs
I used svctraceviewer today. In general - I dislike configuring things and therefore i have a bad habit to forget how i configured something last time. But this seems like what's needed (you just need to configure web.config correctly) - http://www.dasblonde.net/2006/07/27/SvcTraceViewerexeLearnItKnowItLoveIt.aspx Anyway - that will expose only messages and not what your code does.
Arnis L.
A: 

Arnis gives a good suggestion. I'd also suggest using Fiddler to trace WCF traffic assuming you are using a HTTP end point. I've used fiddler to troubleshoot WCF issues so it might be helpful to you as well.

Nathan