I've been using the Service Trace Viewer to analyse the WCF service calls that are made in our application but I really need to see the parameter values that are passed to the service methods? Is this possible? I've tried turning the logging to max output but still can't see anything :(
Asked
Active
Viewed 1.0k times
1 Answers
20
If you enable message tracing, you should get all the details of both the call (including the XML representation of your message sent out) as well as the answer:
<system.diagnostics >
<sources>
<source
name="System.ServiceModel.MessageLogging"
switchValue="Information, ActivityTracing" >
<listeners>
<add name="yourTrace"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="C:\Logs\YourMessageLog.svclog">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<trace autoflush="true" />
</system.diagnostics>
<system.serviceModel>
<diagnostics>
<messageLogging
logMessagesAtTransportLevel="true"
logMessagesAtServiceLevel="false"
logMalformedMessages="true"
logEntireMessage="true"
maxSizeOfMessageToLog="65535000" maxMessagesToLog="500" />
</diagnostics>
</system.serviceModel>
This should create a file called "YourMessageLog.svclog" in a directory "C:\Logs" (which must exist beforehand!) and which you can view with the WCF Service Trace Viewer.
What you'll see here is the XML representation of the message going out and the response coming back in - your parameters will have been wrapped into your XML structure here. Is that what you're looking for?
-
I had tried setting the message logging up in this way before but was doing it on the server rather than the client so it wasn't working as I expected. Cheers for pointing me the right way :) – Martin MacPherson Jul 27 '09 at 11:36
-
1The type for the listeners should be System.Diagnostics.XmlWriterTraceListener – Remco Eissing Aug 26 '10 at 13:55
-
hi I am using on my WCF service DataContract and a function that get int. PLEASE I need to see the parameters that passed to the WCF service on the trace viewer I ca see only the hedear what about the body?? – Ziv.Ti Sep 14 '13 at 14:44