OSB 中的 XQUERY 转换

问题描述 投票:0回答:1

这是后端请求。 { “请求标头”:{ “应用程序ID”:“************”, “应用程序名称”:“TAS” }, “合作伙伴名称”:“Coralpay test 2 Ltd”, "合作伙伴ID": "12345098", "BVN":"12334343434", “银行代码”:[“1920928”] }

我的请求如下,不带 [ ] {“RequestHeader”:{“AppId”:“************”,“AppName”:“TAS”},“PartnerId”:“12345098”,“银行代码”:“1920928”,“ BVN":"12334343434","PartnerName":"Coralpay test 2 Ltd"}

如何在 Xquery 中转换 "BankCode": ["1920928"]?无法转换 [ ] 并从后端收到以下错误: {“type”:“https://tools.ietf.org/html/rfc7231#section-6.5.1”,“title”:“发生一个或多个验证错误。”,“status”:400,“traceId” :"00-838ce74fc427fabf58f773876eb38c72-ed9b230f7c849022-00","errors":{"model":["模型字段是必需的。"],"$.BankCode":["JSON 值无法转换为 System.Collections .Generic.List`1[System.String]。路径:$.BankCode | LineNumber:0 | BytePositionInLine:106。"]}}

我的 xquery 看起来像,

     {
        for $BankCode1 in $partnerOnBoardingRequest/ns1:BankCode
        return 
        <BankCode>{concat(fn:data($BankCode1),'ADDED_STRING_PADDING')}</BankCode>
    }
error-handling xquery osb
1个回答
0
投票

当我如下编写 xquery 时,

{ 对于 $partnerOnBoardingRequest/ns1:bankCode 中的 $BankCode1 返回 [{concat(fn:data($BankCode1),'ADDED_STRING_PADDING')}] }

然后我得到的值是“BankCode”:“[1920928]”,但它应该是“BankCode”:[“1920928”]

请提供解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.