其余Web服务JSON格式

2020-08-19 09:57发布

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

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


你好。

我宣布:

var结果= WebServiceUtilities.ExecuteRESTService(方案名称,服务名称,HttpMethod,HttpResource,URLParameter,HeaderParameter,ContentType,Body);

之后,我将其声明为result.content以获取值。

但是,值的数据类型是字符串。 我想以json格式(数据类型)导入它。 请告诉我如何。

我的内容价值是

:{"结果":" Y","级别":6,"完成":true," trackingDetails":[{"时间":1587718730000,"时间字符串":" 2020-04-24 17:58 :50","代码":null,"其中":"中(大)","种类":"集合"," telno":" 031-577-7520"," telno2":"","备注 ":null,"级别":2," manName":""," manPic":""},{" time":1587736081000," timeString":" 2020-04-24 22:48:01"," 代码":null," where":" Southeast TTM"," kind":" Shuttle Arrival"," telno":" 02-2251-0021"," telno2":""," remark":null," level ":3," manName":""," manPic":""}]," zipCode":null," completeYN":" Y"}。

我想在此处的单独变量中声明'trackingDetails'的'timeString','where'和'kind'值。

谢谢。

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

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


你好。

我宣布:

var结果= WebServiceUtilities.ExecuteRESTService(方案名称,服务名称,HttpMethod,HttpResource,URLParameter,HeaderParameter,ContentType,Body);

之后,我将其声明为result.content以获取值。

但是,值的数据类型是字符串。 我想以json格式(数据类型)导入它。 请告诉我如何。

我的内容价值是

:{"结果":" Y","级别":6,"完成":true," trackingDetails":[{"时间":1587718730000,"时间字符串":" 2020-04-24 17:58 :50","代码":null,"其中":"中(大)","种类":"集合"," telno":" 031-577-7520"," telno2":"","备注 ":null,"级别":2," manName":""," manPic":""},{" time":1587736081000," timeString":" 2020-04-24 22:48:01"," 代码":null," where":" Southeast TTM"," kind":" Shuttle Arrival"," telno":" 02-2251-0021"," telno2":""," remark":null," level ":3," manName":""," manPic":""}]," zipCode":null," completeYN":" Y"}。

我想在此处的单独变量中声明'trackingDetails'的'timeString','where'和'kind'值。

谢谢。

付费偷看设置
发送
2条回答
哎,真难
1楼-- · 2020-08-19 10:43

随着2005年发行的SAP发行了新的Reuse Library JSON,用于将String中的数据解析为JSON。 看看所附的幻灯片。

致谢

Saurabh

野沐沐
2楼-- · 2020-08-19 10:34

嗨,

,当您将application/json作为内容类型传递给API时,API会将其视为请求有效内容类型。 因此,它与检索JSON对象中的响应无关。 在C4C中,您总是会以字符串形式获得响应(即使是JSON字符串),因此,使用新引入的库,您可以将字符串解析为JSON表格数据。

关于您所面临的错误,作为返回码 是200(检查DT_result.code),因此已成功触发API,但是根据我的假设,目标处理器系统已拒绝或引发了错误。

一周热门 更多>