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

2020-09-16 08:44发布

         点击此处--->   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导入多个交互有任何想法吗?

最诚挚的问候


         点击此处--->   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条回答
Nan4612
1楼-- · 2020-09-16 09:36

嗨鲁本斯,

对于json文件,有一个包含json有效负载的数组。 您可以对阵列进行另一个测试吗?

对于批处理模式,POST位于"位置"上,但应为"交互"。
下面是一个具有多个交互的批处理请求的示例。
(对不起,格式错误)

-批处理内容类型:多部分/混合; boundary = changeset_1 --changeset_1内容类型:application/http content-transfer-encoding:二进制POST交互HTTP/1.1接受:application/json Sap-Cuan-SourceSystemType:EXT Sap-Cuan-SourceSystemId:CPI内容类型:application/json Sap-Cuan-ForceSynchronousProcessing:X {" InteractionContactOrigin":" SAP_HYBRIS_CONSUMER"," InteractionContactId":" JHI_001"," CommunicationMedium":" ONLINE_SHOP"," InteractionType":" PROD_REVIEW_CREATED"," InteractionTimeStampUTC--03 06T12:12:24"," SourceSystemType":" COM"," SourceSystem":" SAP_MERCH_SHOP"," InteractionContent":" 2018-03-28交互产品测试01"} --changeset_1内容类型:application/http content -transfer-encoding:二进制POST交互HTTP/1.1接受:application/json Sap-Cuan-SourceSystemId:EXT Sap-Cuan-SourceSystemId:CPI内容类型:application/json Sap-Cuan-ForceSynchronousProcessing:X {" InteractionContactOrigin":" SAP_HYBRIS_CONSUMER"," InteractionContactId":" JHI_001"," CommunicationMedium":" ONL INE_SHOP"," InteractionType":" PROD_REVIEW_CREATED"," InteractionTimeStampUTC":" 2018-03-06T12:12:25"," SourceSystemType":" COM"," SourceSystem":" SAP_MERCH_SHOP"," InteractionContent":" 2018- 03-28互动产品测试02"} --changeset_1-- --batch-

br

Johannes

当学会了学习
2楼-- · 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--
  - 批量 - 


 
宇峰
3楼-- · 2020-09-16 09:28

我有类似的错误。

在邮递员中,这是我的要求(有效)

-批处理内容类型:多份/混合; boundary = changeset_761e49b6-3146-4a57-8d10-15816fb9c751

-changeset_761e49b6-3146-4a57-8d10-15816fb9c751

内容类型:application/http

POST Interactions()HTTP/1.1

内容类型:application/json

{

" InteractionContactOrigin":" SAP_HYBRIS_CONSUMER",

" InteractionContactId":" 92a2fc8549a4ad28",

" CommunicationMedium":" ONLINE_SHOP",

" InteractionType":" SHOP_ITEM_VIEW",

" InteractionTimeStampUTC":" 1970-01-18T17:14:48",

" InteractionAmount":" 0",

" InteractionCurrency":" EUR",

" DeviceType":"智能手机",

" SourceSystemType":" iOS 11.3",

" InteractionProducts":[{

" ProductOrigin":" SAP_HYBRIS_PRODUCT",

"产品":" 1288120"

}]

}

但是在CPI(云平台集成)中,它表示:

LastError = com.thoughtworks.xstream.converters.ConversionException:OSCI问题:OSCI问题----调试信息----消息:OSCI问题原因:com.sap.gateway.core.ip.processor。 exception.ODataProcessingException原因消息:OSCI问题类:java.util.ArrayList必需类型:java.util.ArrayList转换器类型:com.sap.gateway.core.ip.processor.converter.ConverterXMLToList路径:/batchParts/batchChangeSet/batchChangeSetPart/Interactions行号:2版本:null

有什么主意吗?

最好的问候

C撒

一周热门 更多>