无法记录WCF消息正文

时间:2014-10-23 20:52:48

标签: wcf logging biztalk trace system.diagnostics

我使用32位BizTalk 2013r1主机实例通过LOB适配器向Oracle发送插入请求。

我需要跟踪正在发送的邮件正文。我已按如下方式配置btsntsvc.exe.config:

<configuration>
<system.diagnostics>
    <sources>
        <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing">
            <listeners>
                <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                    <filter type="" />
                </add>
                <add name="xml">
                    <filter type="" />
                </add>
            </listeners>
        </source>
        <source name="System.ServiceModel.MessageLogging" switchValue="Verbose, ActivityTracing">
            <listeners>
                <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                    <filter type="" />
                </add>
                <add name="xml">
                    <filter type="" />
                </add>
            </listeners>
        </source>
        <source name="System.Runtime.Serialization" switchValue="Verbose">
            <listeners>
                <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                    <filter type="" />
                </add>
                <add name="xml">
                    <filter type="" />
                </add>
            </listeners>
        </source>
    </sources>
    <sharedListeners>
        <add initializeData="C:\logs\WCFTrace2.svclog" type="System.Diagnostics.XmlWriterTraceListener"
name="xml" traceOutputOptions="LogicalOperationStack">
            <filter type="" />
        </add>
    </sharedListeners>
    <trace autoflush="true" />
</system.diagnostics>

<system.serviceModel>
    <client>
        <remove contract="IMetadataExchange" name="oracledb" />
        <endpoint binding="oracleDBBinding" contract="IMetadataExchange"
name="oracledb" />
    </client>
    <diagnostics>
        <messageLogging logEntireMessage="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
        <endToEndTracing activityTracing="true" messageFlowTracing="true" />
    </diagnostics>
</system.serviceModel>

我的问题是,虽然记录了邮件的标题,但主体只是记录为&#34; ... stream ...&#34;

<MessageLogTraceRecord>
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing"      xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action     s:mustUnderstand="1">http://Microsoft.LobServices.OracleDB/2007/03/BTS/Table/FOOTFALL/Insert</a:Action>
<a:MessageID>urn:uuid:5925f3c6-7670-4eaf-843f-df18a609a4fd</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
</s:Header>
<s:Body>... stream ...</s:Body>
</s:Envelope>
</MessageLogTraceRecord>

请问我能告诉我需要做些什么才能获得邮件正文的日志?

1 个答案:

答案 0 :(得分:0)

创建另一个使用FILE适配器的发送端口非常简单。

  • 设置过滤器以捕获将转至Oracle
  • 的相同消息
  • 添加相同的地图

然后,这将为每个请求将文件写入某个位置,并包含与发送到Oracle适配器相同的消息体内容。