wso2 - wso2 esb 在 xslt 转换后注入很少的值
问题描述
我正在从源表中读取一些值并写入目标表。由于字段的名称和某些值不同,我在 WSO2 ESB 中使用 XSLT 中介。在 xslt 调解器之后,我想向有效负载中注入更多值。说一下我以前存储的一些变量。我不能这样做 xslt 因为这些值在某些变量中。所以下面是我的代码。虚线的代码应该是什么?
<enrich>
<source clone="true" property="SOURCE_TABLE_PAYLOAD" type="property"/>
<target type="body"/>
</enrich>
<xslt key="gov:/bcogc/transformation/SourcetoTargetTransformation.xslt"/>
----------------ADD SOME MORE VALUES HERE to the payload------------------
<header name="Action" scope="default" value="urn:inserttotargettable"/>
<call>
<endpoint key="gov:/endpoints/INSERT_DataService_EP.xml"/>
</call>
请扔一些灯
解决方案
例如,您可以再次使用丰富的调解器,
<property name="orderID" scope="default" description="orderID">
<orderID xmlns="">2</orderID>
</property>
<enrich>
<source clone="true" xpath="$ctx:orderID"/>
<target action="sibling" xpath="//orders"/>
</enrich>
这里定义了 orderID 属性,所以现在您可以将该属性添加为与来自 XSLT 的请求的同级,因此在丰富后请求将如下所示
<orders>
<order>
<price>50.00</price>
<quantity>500</quantity>
<symbol>IBM</symbol>
<comment>REF 10053</comment>
</order>
<order>
<price>18.00</price>
<quantity>500</quantity>
<symbol>MSFT</symbol>
<comment>ref 20088398289</comment>
</order>
</orders>
<orderID>2</OrderID>
推荐阅读
- ios - Xcode 如何制作圆形滑块
- c# - 多层次的任务
- java - 使用 JWT 进行身份验证的 Spring Security OpenID 流
- java - Kafka Spark Streaming 缓存
- google-drive-api - 如何为每个用户的会话生成带有令牌的谷歌驱动器链接?
- android - Android Studio:源代码未附加到调试代码
- c# - 索赔查找表
- ios - 距离过滤器在标准位置服务中未按预期工作
- rails-activestorage - Rails 5.2 Rest API + Active Storage - 上传从外部服务接收的文件 blob
- c - 根据其中一个元素对结构进行排序