【问题标题】:wso2 xpath expression in property mediator doesn't work属性调解器中的 wso2 xpath 表达式不起作用
【发布时间】:2017-12-08 10:45:24
【问题描述】:

我正在尝试在 WSO2 代理中填充属性。我正在使用以下语法和 xpath 表达式:

<property expression="//RelationValueList/PersonnelRelationValueUnitType[RelAttrId='R54' and DateTo=max(//RelationValueList/PersonnelRelationValueUnitType[RelAttrId='R54']/DateTo/xs:dateTime(.))][last()]/RelationValue" name="RelValue" scope="default" type="STRING"/>

这个 Xpath 表达式在在线 Xpath 测试器中运行良好。但是当在属性中介的 WSO2 表达式中使用它时,它会给我以下 Eclipse 错误:

wso2 未知突触配置标签

Error message

XML 文档如下所示:

<GetPersonnelResponse>
 <GetPersonnelResult>
    <RelationValueList>
       <PersonnelRelationValueUnitType>
          <RelAttrId>C1</RelAttrId>
          <RelationValue>1234</RelationValue>
          <DateFrom>1900-01-02T00:00:00</DateFrom>
          <DateTo>2199-12-31T00:00:00</DateTo>
       </PersonnelRelationValueUnitType>
       <PersonnelRelationValueUnitType>
          <RelAttrId>R54</RelAttrId>
          <RelationValue>GEN123</RelationValue>
          <DateFrom>1900-01-02T00:00:00</DateFrom>
          <DateTo>2017-12-04T00:00:00</DateTo>
       </PersonnelRelationValueUnitType>
       <PersonnelRelationValueUnitType>
          <RelAttrId>R54</RelAttrId>
          <RelationValue>GEN456</RelationValue>
          <DateFrom>2017-12-05T00:00:00</DateFrom>
          <DateTo>2099-12-31T00:00:00</DateTo>
       </PersonnelRelationValueUnitType>
    </RelationValueList>
 </GetPersonnelResult>
</GetPersonnelResponse>

在 WSO2esb 中启用了 Xpath 2.0。 我需要选择具有最高 DateTo 值的 RelationValue。如果有多个值,我取最后一个。

有人知道如何解决这个问题吗?

【问题讨论】:

  • 这是完整的错误日志吗?
  • 这是来自 Eclipse 的错误。我刚刚添加了完整错误消息的屏幕截图。
  • 有人有想法吗?

标签: eclipse xpath properties wso2 mediator


【解决方案1】:

您在表达式中使用命名空间 xs:。您需要在 it mediator 的顶级父标签中定义它。

【讨论】:

  • 我将 xmlns:xs="w3.org/2001/XMLSchema" 添加到属性调解器,但仍然没有运气。发生同样的错误。当我从 xs:dateTime 中删除 (.) 字符时,Eclipse 在保存时不会给我一个错误。但是在运行时它也不起作用。但是似乎不允许使用(。)字符。
猜你喜欢
  • 2012-09-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-02-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多