ibm-datapower - Datapower - 转换查询不将 JSON 转换为 JSONX
问题描述
我有一个以前工作过的非常简单的用例。但是在这个新的mpgw中,流量是
url-open 到 API 并获取 json 响应并在发送到客户端之前处理该响应,它不起作用。
我在 xslt 中尝试过以下内容
<xsl:variable name="Response">
<dp:url-open target="{$routing_URL}" response="responsecode-binary" http-method="get" ssl-proxy="client:mpgw_Client_SSL_Profile" timeout="'10'">
</dp:url-open>
</xsl:variable>
<!-- Decoding the binary node so that it can be further used in the processing rules -->
<xsl:variable name="json">
<xsl:copy-of select="dp:decode(dp:binary-encode($Response/result/binary/node()), 'base-64' )" />
</xsl:variable>
<dp:set-variable name="'var://context/service_session/json'" value="string($json)" />
<xsl:value-of select="$json"/>
我可以看到获取 json 数据的上下文变量。但是,当我在此转换操作之后使用转换查询参数时,它会失败并出现以下错误:
Convert HTTP produced invalid XML: Incomplete markup or missing
document element at offset 39 of ...
我也尝试在变换的输出和下一个变换的输入中使用上下文 __JSONASJSONX,但数据也没有转换为 JSONX。
我已经阅读了其他论坛,其中此错误意味着数据为空,但我可以在上下文变量中看到数据。
知道这里可能出了什么问题吗?
解决方案
推荐阅读
- javascript - React Native 应用程序显示 --signinwithemailandpassword failed: 第一个参数“email”必须是一个有效的字符串
- validation - 为 .NET Core Identity 2.1 覆盖 UserValidator.cs 中的 ValidateAsync
- javascript - MusicKitJS:无法播放用户库中的歌曲
- javascript - 在我单击“停止加载此页面”之前,onload 事件不会在 chrome 中触发
- c# - 从卸载的页面触发的事件
- java - 在 Spring Boot 中向 CRUDReposity 接口添加自定义方法
- mysql - 如果行存在,则更新(删除)值
- vb.net - 创建一个数组来存储日期值 (dd/mm/yyyy)
- r - 如何在查找查询中将超时设置为 false 以摆脱 Mongolite(R) 中的“未找到光标 ID 执行停止”问题
- java - 同步多个线程编辑一个Hashmap