【发布时间】:2011-02-17 15:46:57
【问题描述】:
This question 似乎与我正在寻找的非常接近 - 我能够设置跟踪,并且正在查看我对服务的调用的日志条目。
但是,我需要查看原始 soap 请求以及我发送到服务的数据,并且我看不到从 SvcTraceViewer 执行此操作的方法(仅显示日志条目,但没有发送到服务的数据) - 我只是缺少配置?
这是我在 web.config 中得到的:
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Verbose"
propagateActivity="true">
<listeners>
<add name="sdt"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="App_Data/Logs/WCFTrace.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
任何帮助表示赞赏!
更新:这就是我在跟踪中看到的全部内容:
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>262163</EventID>
<Type>3</Type>
<SubType Name="Information">0</SubType>
<Level>8</Level>
<TimeCreated SystemTime="2010-05-10T13:10:46.6713553Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{00000000-0000-0000-1501-0080000000f6}" />
<Execution ProcessName="w3wp" ProcessID="3492" ThreadID="23" />
<Channel />
<Computer>MY_COMPUTER_NAME</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
<TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Channels.MessageSent.aspx</TraceIdentifier>
<Description>Sent a message over a channel.</Description>
<AppDomain>MY_DOMAIN</AppDomain>
<Source>System.ServiceModel.Channels.HttpOutput+WebRequestHttpOutput/50416815</Source>
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/MessageTraceRecord">
<MessageProperties>
<Encoder>text/xml; charset=utf-8</Encoder>
<AllowOutputBatching>False</AllowOutputBatching>
<Via>http://xxx.xx.xxx.xxx:9080/MyWebService/myService</Via>
</MessageProperties>
<MessageHeaders></MessageHeaders>
</ExtendedData>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
【问题讨论】: