soap:DateWeave(json转xml映射,xml中包含json)

案例:
在这里插入图片描述

来源结构json:

{
    "param": "{\"bus_account\":\"2950891\",\"interface_code\":\"JK20230320000002\",\"body\":{\"data\":{\"list\":[{\"refundsDeliveryNumber\":\"INSD202303310523\",\"refundsDeliveryTime\":\"2023-04-03 00:00:00\",\"refundsDeliveryType\":\"IQC_RETURN\",\"toElsAccount\":\"VEN00039\",\"refundsDeliveryStatus\":\"6\",\"refundsReason\":\"\",\"refundsPrincipal\":\"节卡.孙\",\"purchaseOrg\":\"C002\",\"purchaseRefundsDeliveryItemList\":[{\"orderNumber\":\"CGDDR20230329\",\"materialNumber\":\"2209000031\",\"refundsQuantity\":\"\",\"itemStatus\":\"7\",\"orderItemNumber\":\"10\",\"storageLocation\":\"W201\"}]},{\"refundsDeliveryNumber\":\"INSD202303311046\",\"refundsDeliveryTime\":\"2023-03-31 00:00:00\",\"refundsDeliveryType\":\"IQC_RETURN\",\"toElsAccount\":\"VEN00039\",\"refundsDeliveryStatus\":\"6\",\"refundsReason\":\"\",\"refundsPrincipal\":\"节卡.孙\",\"purchaseOrg\":\"C002\",\"purchaseRefundsDeliveryItemList\":[{\"orderNumber\":\"CGDDR20230329\",\"materialNumber\":\"2209000031\",\"refundsQuantity\":\"\",\"itemStatus\":\"7\",\"orderItemNumber\":\"10\",\"storageLocation\":\"W201\"}]}]},\"busAccount\":\"2950891\",\"simpleFlag\":\"1\",\"interfaceCode\":\"getRefundsDeliveryHeadFromWms\"}}",
    "secret": "8ed9e3c00f5b4e78bc2650be619db1fa",
    "key": "dba2b4a8"
}

目标结构xml:

<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Header>
    <qqt:key xmlns:qqt="https://www.51qqt.com">dba2b4a8</qqt:key>
    <qqt:secret xmlns:qqt="https://www.51qqt.com">8ed9e3c00f5b4e78bc2650be619db1fa</qqt:secret>
  </soap:Header>
  <soap:Body>
    <qqt:invokeByKey xmlns:qqt="https://www.51qqt.com">
      <param>{"bus_account":"2950891","interface_code":"JK20230320000002","body":{"data":{"list":[{"refundsDeliveryNumber":"INSD202303310523","refundsDeliveryTime":"2023-04-03 00:00:00","refundsDeliveryType":"IQC_RETURN","toElsAccount":"VEN00039","refundsDeliveryStatus":"6","refundsReason":"","refundsPrincipal":"节卡.孙","purchaseOrg":"C002","purchaseRefundsDeliveryItemList":[{"orderNumber":"CGDDR20230329","materialNumber":"2209000031","refundsQuantity":"","itemStatus":"7","orderItemNumber":"10","storageLocation":"W201"}]},{"refundsDeliveryNumber":"INSD202303311046","refundsDeliveryTime":"2023-03-31 00:00:00","refundsDeliveryType":"IQC_RETURN","toElsAccount":"VEN00039","refundsDeliveryStatus":"6","refundsReason":"","refundsPrincipal":"节卡.孙","purchaseOrg":"C002","purchaseRefundsDeliveryItemList":[{"orderNumber":"CGDDR20230329","materialNumber":"2209000031","refundsQuantity":"","itemStatus":"7","orderItemNumber":"10","storageLocation":"W201"}]}]},"busAccount":"2950891","simpleFlag":"1","interfaceCode":"getRefundsDeliveryHeadFromWms"}}</param>
    </qqt:invokeByKey>
  </soap:Body>
</soap:Envelope>

脚本:

%dw 2.0         
output application/xml         
ns soap http://www.w3.org/2003/05/soap-envelope         
ns qqt https://www.51qqt.com         
---         
{
        soap#Envelope: {
                soap#Header: {
                        qqt#key: payload.key,
                        qqt#secret: payload.secret,
                },
                soap#Body: {
                        qqt#invokeByKey: {
                                param: payload.param
                        },
                },
        },
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值