Hybris Marketing onPremise API API_MKT_INTERACTION_SRV/与多个实体的交互

2020-09-16 08:44发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中) 大家好, 我正在尝试使用...

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

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


大家好,

我正在尝试使用API​​ API API_MKT_INTERACTION_SRV/Interactions导入多个交互,并且出现错误"解析XML流时出错"。

这是我建造的Json:

[{" InteractionSourceObject":" RB_000006"," InteractionSourceObjectType":" INVOICE"," InteractionTimeStampUTC":" 2018-02-10T09:00:00"," InteractionContactId":" 8148791"," InteractionContactOrigin":" ZPASSPORT"," InteractionAmount":" 2000.00"," InteractionType":" SALES_ORDER"," CommunicationMedium":" BUSINESS_DOCUMENT"," ZZ1_SalesCost_MIA":" 1837.00"," ZZ1_OrderImcoming_MIA":" 1138.00"," ZZ1_TheoricSales ," ZZ1_TotalDiscount_MIA":" 50.00"," ZZ1_Store_MIA":" 1234"," InteractionCurrency":" BRL"," InteractionProducts":[{" Product":" RB_1234"," ProductOrigin":" SAP_HYBRIS_PRODUCT"," InteractionProductQuantity" :" 2.00"," InteractionProductUnit":" KGM"," InteractionProductAmount":" 500.00"," ZZ1_OfferId_MIP":" 123456"},{" Product":" RB_1235"," ProductOrigin":" SAP_HYBRIS_PRODUCT"," InteractionProductQuantity" :" 2.00"," InteractionProductUnit":" KGM"," InteractionProductAmount":" 500.00"," ZZ1_OfferId_MIP":" 123456"}]},{" InteractionSo urceObject":" RB_000007"," InteractionSourceObjectType":" INVOICE"," InteractionTimeStampUTC":" 2018-02-11T09:00:00"," InteractionContactId":" 8148791"," InteractionContactOrigin":" ZPASSPORT"," InteractionAmount" :" 2000.00"," InteractionType":" SALES_ORDER"," CommunicationMedium":" BUSINESS_DOCUMENT"," ZZ1_SalesCost_MIA":" 1837.00"," ZZ1_OrderImcoming_MIA":" 1138.00"," ZZ1_TheoricSalesPrice_MIA":" 1921,0" 50.00"," ZZ1_Store_MIA":" 1234"," InteractionCurrency":" BRL"," InteractionProducts":[{"" Product":" RB_1234"," ProductOrigin":" SAP_HYBRIS_PRODUCT"," InteractionProductQuantity":" 2.00"," InteractionProductUnit":" KGM"," InteractionProductAmount":" 500.00"," ZZ1_OfferId_MIP":" 123456"},{" Product":" RB_1235"," ProductOrigin":" SAP_HYBRIS_PRODUCT"," InteractionProductQuantity":" 2.00"," InteractionProductUnit":" KGM"," InteractionProductAmount":" 500.00"," ZZ1_OfferId_MIP":" 123456"}]}]

这是退货:

http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> CX_SXML_PARSE_ERROR/001560AA0E081DEB8CA398CC1690D406 解析XML流时出错 CEC-MKT-DM-IA /SAP/ API_MKT_INTERACTION_SRV 0001 223B7B4444B30080E005AB98085AA93F 20180328152830.2430970 对于后端管理员:在SAP Gateway集线器系统上运行事务/IWFND/ERROR_LOG并搜索具有上述时间戳的条目以获取更多详细信息 有关错误分析,请参见SAP注释1797736( https://service.sap.com/sap/support/notes/1797736)>

我确实尝试过使用bacth模式进行上传:

-批处理内容类型:多部分/混合; boundary = changeset --changeset内容类型:application/http内容传输编码:二进制POST位置HTTP/1.1内容类型:application/atom + xml内容长度:10000 <?xml version =" 1.0" encoding =" utf-8" standalone =" yes"?> RB_000006 > INVOICE 2018-02-10T09:00:00 8148791 8148791 --changeset内容类型:application/http Content-Transfer- 编码:二进制POST位置HTTP/1.1内容类型:application/atom + xml内容- 长度:10000 <?xml version =" 1.0" encoding =" utf-8" standalone =" yes"?> RB_000006 INVOICE 2018-02-10T09:00 :00 8148791 8148791 --changeset---批处理-

但是我收到了错误的媒体类型错误

您对我如何使用此API导入多个交互有任何想法吗?

最诚挚的问候


3条回答
当学会了学习
2020-09-16 09:35

嗨,

我也为包含InteractionProducts的交互的有效负载而苦苦挣扎; 还有很多"解析XML流时出错"错误,诸如"交互作用或产品级别缺少"金额"货币"的应用程序日志错误以及其他错误;

最后在一些帮助下,我们获得了有效的负载。

我希望这可以帮助某人:

URL:https://host:port/sap/opu/odata/sap/API_MKT_INTERACTION_SRV/$ batch

标题:

-x-csrf令牌

-Content-Type:multipart/mixed; boundary = batch

-批量
 内容类型:多部分/混合;  boundary = changeset_1


 --changeset_1
 内容类型:application/http
 内容传输编码:二进制


 POST交互HTTP/1.1
 内容长度:1035
 接受:application/json
 Sap-Cuan-RequestTimestamp:'2018-04-09T08:14:14'
 Sap-Cuan-SourceSystem类型:EXT
 Sap-Cuan-SourceSystemId:TEST
 内容类型:application/json


 {
   " InteractionContactOrigin":" SAP_HYBRIS_CONSUMER",
   " InteractionContactId":" JHI_001",
   " CommunicationMedium":" BUSINESS_DOCUMENT",
   " InteractionType":" SALES_ORDER",
   " InteractionTimeStampUTC":" 2018-04-09T08:14:14",
   " InteractionCurrency":" EUR",
   " InteractionProducts":
   [{
   " ProductOrigin":" SAP_ERP_MATNR",
   "产品":" 170",
   " InteractionProdWeightingFactor":1,
   " InteractionProductSentimentVal":1,
   " InteractionProductQuantity":" 2",
   " InteractionProductUnit":" pc",
   " InteractionProductAmount":" 3.20",
   " InteractionProductReason":" EF-TEST"
   }]
 }


 --changeset_1--
  - 批量 - 


 

一周热门 更多>