无法记录WCF消息正文

3
我正在使用一个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>

我的问题是,虽然消息的标题已记录,但正文仅记录为“…stream…”

<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>

请问我需要做什么才能获取消息正文的日志记录?


你为什么要尝试使用 WCF 消息记录而不是 BizTalk 跟踪机制?你是否尝试在 WCF 端口上启用跟踪? - oɔɯǝɹ
当BizTalk适配器无法发送消息时,跟踪数据库中没有可用的内容。 - Rob Bowman
嗯,那么似乎还有另一个问题,并非直接与消息相关。Windows事件日志中是否有消息? - oɔɯǝɹ
问题是:我发送的请求被Oracle拒绝了。我已经克服了这个问题。但我认为这个问题仍然存在,当Oracle适配器失败时,在跟踪数据库中没有任何消息。唯一帮助故障排除的替代方法是使用WCF跟踪,但它只显示消息信封和标头,这很有帮助,但不显示消息正文。 - Rob Bowman
你是如何发现出了什么问题的? - oɔɯǝɹ
1个回答

0

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

  • 将过滤器设置为捕获与将发送到Oracle的相同消息
  • 添加相同的映射

这将为每个请求编写一个文件,并包含与将发送到Oracle适配器相同的消息正文内容。


是的,我已经这样做了,但我想使用WCF跟踪,因为我需要检查响应 - 但似乎没有到达消息框。我猜测消息正文的跟踪可能不起作用,因为适配器正在流式传输,但我愿意听取建议。 - Rob Bowman
你为什么认为响应似乎没有到达消息框?是因为没有路由失败吗?要获取从发送端口返回的响应,您可以尝试使用以下方法:https://social.msdn.microsoft.com/Forums/en-US/a459dfe2-91c8-4ece-bd8e-2b838d8c343d/how-to-capture-a-response-received-using-two-way-static-solicit-response-send-port-without-having?forum=biztalkgeneral - Gruff
我已经在端口上启用了所有跟踪,但是当我查看“跟踪消息事件”时,什么也没有显示。 - Rob Bowman

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接