【问题标题】:IBM Integeration BUS: Trace NodeIBM 集成总线:跟踪节点
【发布时间】:2016-03-01 11:01:03
【问题描述】:

在有 3 个节点的简单消息流中。一个是接收 xml 输入的 MQ 输入节点。另一个是 MQ 输出节点,它正在接收从 MQ 输入传递的消息。中间有跟踪节点。跟踪节点被配置为在文件中生成跟踪。它追踪整个 xml msg,它在文件中的内容。如果我想跟踪 xml 文件的单个标签,比如联系电话,该怎么办。

即:

<contactDetails>
    <contactName>Acme</contactName>
    <contactNumber>09200209</contactNumber>
</contactDetails>

我应该使用哪种模式?我尝试过${Body.contactDetails.contactNumber}${Environment.contactDetails.contactNumber},但我的输出为空。有人可以帮忙吗?

编辑:以下是整个消息:

<?xml version="1.0" encoding="utf-8"?>
<tns:In_Request xmlns:tns="http://www.ibm.lab.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ActionRequest>O</ActionRequest>
    <DateRequest>10/12/2005</DateRequest>
    <customerNumber>1</customerNumber>
    <customerName>ACME Hardware</customerName>
    <customerDetails>
        <customerAddress1>1254 Main St</customerAddress1>
        <customerAddress2>Suite 12</customerAddress2>
        <customerCity>Dime Box</customerCity>
        <customerState>TX</customerState>
        <customerCountry>USA</customerCountry>
        <customerPostalCode>76543</customerPostalCode>
        <customerCreditLimit>1200</customerCreditLimit>
        <customerCreditScore>123</customerCreditScore>
    </customerDetails>
    <contactDetails>
        <contactFirstName>Freddy</contactFirstName>
        <contactLastName>Bloggs</contactLastName>
        <contactPhoneNumber>555-123-6543</contactPhoneNumber>
    </contactDetails>
    <requestDecision>Y</requestDecision>
    <comments>Just a Comment</comments>
    </tns:In_Request>

【问题讨论】:

  • 这些模式应该可以工作。难道你的 XML 元素没有命名空间吗?
  • 是的,以下是名称空间:xmlns:tns="http://www.ibm.lab.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  • 这些似乎来自 XSD 而不是您的消息。你能在你的问题中包含整个信息吗?
  • 当然!我已经编辑了这个问题。请检查!

标签: ibm-mq ibm-integration-bus


【解决方案1】:

我现在看到了问题。 引用中的正文指向解析消息的域的根元素,例如如果在消息的输入节点上将消息域设置为 XMLNSC,则设置为 Root.XMLNSC,而不是设置为消息的根元素。

如果您想从示例消息中跟踪元素 contactPhoneNumber 的值,您应该使用以下参考: ${Body.*:In_Request.contactDetails.contactPhoneNumber}

因此,在 Body 之后,您必须指定元素的整个路径。 *: 部分是必需的,因为消息中的根元素位于命名空间中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多