使用REST适配器剥离JSON中的标签名称

2020-08-21 16:46发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)你好 我们必须将来自SAP...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


你好

我们必须将来自SAP的多个地址记录发布到第三方REST服务。我们在PO 7.5上。

我们正在使用ABAP PROXY到PI到REST的接口。

我已经使用出现0-n的Address元素创建了数据类型。 已将其分配给消息类型MT_ADDRESS。

REST适配器上的XML至JSON转换已用于将输入XML转换为JSON。

使用此设置,下面的JSON被发送到REST服务。

{" 地址":[

{"代码":" POST1","名称":" Test POS Address 1"," erpId":" POST1"," line1":" Address 1 Line 1"," line2":" Address 1 Line" 2"," city":" City1"," state":" MA"," zip":19501," country":" US"," shipTo":true," billTo":true," invoiceTo":true }

{"代码":" POST2","名称":" Test POS Address 2"," erpId":" POST2"," line1":" Address 2 Line 1"," line2":" Address 2 Line" 2"," city":" City2"," state":" MA"," zip":19502," country":" US"," shipTo":true," billTo":true," invoiceTo":true }

]}

预期格式:

[

{"代码":" POST1","名称":" Test POS Address 1"," erpId":" POST1"," line1":" Address 1 Line 1"," line2":" Address 1 Line" 2"," city":" City1"," state":" MA"," zip":19501," country":" US"," shipTo":true," billTo":true," invoiceTo":true }

{"代码":" POST2","名称":" Test POS Address 2"," erpId":" POST2"," line1":" Address 2 Line 1"," line2":" Address 2 Line" 2"," city":" City2"," state":" MA"," zip":19502," country":" US"," shipTo":true," billTo":true," invoiceTo":true }

]

我的消息类型是MT_ADDRESS,由于设置了"剥离外部元素",该消息类型已经被剥离。

但是我找不到剥离"地址"标签的方法吗?

请帮助?

3条回答
2020-08-21 17:14

嗨Soumya,

AFAIK,"条形外部元素"只是删除了消息的操作。 另外,由于要删除标头标记,因此可以在将XML Anoymizer bean转换为JSON之前使用它-

在XML中通过XMLAnonymizer Bean删除PI中的命名空间| | | SCN

问候,

Nitin

一周热门 更多>