每个OData将CPI邮寄到ByD

2020-09-16 10:59发布

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

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


嗨,

我试图通过使用POST方法使用CPI Odata适配器和我通过SAP ByDesign Odata Modeller创建的给定OData服务来创建实体。

通过邮递员,我可以通过获取一个csrf令牌,然后发送一个发布请求来创建一个简单的实体。

通过CPI,由于遇到以下错误,我无法添加此实体:

com.sap.gateway.core.ip.component.odata.exception.OsciException:由:org.apache.olingo.odata2.api.edm.EdmSimpleTypeException引起:元数据不允许为空值。 在EntitySet ProjectCollection中,元数据不允许为属性" ObjectID"提供null值。

由于ObjectID是新对象的NodeID,因此在请求时我不知道该ObjectID。 通过邮递员,我不需要此字段。 我的请求正文在邮递员中看起来像这样:

{

" ProjectID":" ProjectID",

" TypeCode":" TypeCode",

" LanguageCode":" LanguageCode",

" ResponsibleCostCentreID":" ResponsibleCostCentreID",

" ProjectProjectSummaryTask":

{

" ResponsibleEmployeeUUID":" ResponsibleEmployeeUUID"

}

}

对于CPI中的映射,我使用从远程OData服务的odata向导创建的xsd,并将其推送到Odata适配器。

在堆栈跟踪下方:

com.sap.gateway.core.ip.component.odata.exception.OsciException:内部服务器错误:500:HTTP/1.1 OData方法:CREATE_ENTRY请求URI:POST HTTP/1.1请求标头:MessageId:null SAP_MplCorrelationId:AFtEXvgw -y5AWi82frvYlUKemQfT SAP_PregenicMplId:AFtEXvgsOONB9mVBbLU7toerc0_N授权:基本********内容类型:application/atom + xml接受:application/atom + xml x-csrf-token:******** Cookie:sap- usercontext = ********; 路径=/; MYSAPSSO2 = ********; 路径=/; 安全; HttpOnly; SAP_SESSIONID_LF4_081 = ********; 路径=/; 安全; HttpOnly; HTTP状态行:HTTP/1.1 500内部服务器错误响应标头:内容长度:227 sap-message:{"代码":" ODATA_ERROR","消息":"处理期间发生错误","严重性":"错误" ," target":""," details":[{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":"","严重性":"错误"} ,{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":""," severity":" error"}]} c4c-odata-response-time:572 ms ODataV2_Adapter_Response_Body: ERROR http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> ERROR xml:lang =" zh_cn"属性不存在::属性不存在 OData方法:CREATE_ENTRY请求URI:POST HTTP/1.1请求标头:MessageId:空SAP_MplCorrelationId:AFtEXvgw-y5AWi82frvYlUKemQfT SAP_PregenicMplId:AFtEXvgsOONB9mVBbLU7toerc0_N授权:基本******/atom内容/应用: + xml x-csrf-token:******** Cookie:sap-usercontext = ********; 路径=/; MYSAPSSO2 = ********; 路径=/; 安全; HttpOnly; SAP_SESSIONID_LF4_081 = ********; 路径=/; 安全; HttpOnly; HTTP状态行:HTTP/1.1 500内部服务器错误响应标头:内容长度:227 sap-message:{"代码":" ODATA_ERROR","消息":"处理期间发生错误","严重性":"错误" ," target":""," details":[{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":"","严重性":"错误"} ,{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":""," severity":" error"}]} c4c-odata-response-time:572 ms ODataV2_Adapter_Response_Body: ERROR http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> ERROR xml:lang =" zh_cn"属性不存在::属性不存在 在com.sap.gateway.core.ip.component.odata.exception.LogHelper.handleException(LogHelper.java:202)处com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor.createEntity(OsciOdataRequestProcessor。 com.sap.gateway.core.ip.component.odata.runtime.ODataClientProducer.process(ODataClientProducer.java:284)处的org.apache.camel.util.AsyncProcessorConverterHelper $ ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:java:1818) 61)在org.apache.camel.processor.SendProcessor $ 2.doInAsyncProducer(SendProcessor.java:173)在org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:341)在org.apache.camel.processor。 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:95)处的SendProcessor.process(SendProcessor.java:168)在com.sap.it.op.agent.collector.camel.MplInterceptor $ MplAsyncProcessor.process( MplInterceptor.java:180),位于org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.ja va:95)org.apache.camel.processor.RedeliveryErrorHandler.java:468(org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)org.apache.camel.processor org.apache.camel.processor的.Pipeline.process(Pipeline.java:121)org.org的org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)的Pipeline.process(Pipeline.java:83) org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)上的org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)在org.apache.camel.processor.DelegateAsyncProcessor上。 com.sap.it.op.agent.collector.camel.MplInterceptor $ MplAsyncProcessor.process(MplInterceptor.java:180)处的process(DelegateAsyncProcessor.java:95)org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor。 java:95),位于org.apache.camel.processor.Camel,位于org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468) org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)的InternalProcessor.process(CamelInternalProcessor.java:197)org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:44) 在org.apache.camel.processor.loadbalancer.LoadBalancerSupport.process(LoadBalancerSupport.java:97)的org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)处 org.quartz.core.JobRunShell.run(JobRunShell.java:202)的.CamelJob.execute(CamelJob.java:58)org.quartz.simpl.SimpleThreadPool $ WorkerThread.run(SimpleThreadPool.java:573)的原因 com.sap.gateway.core.ip.component.odata.exception.OsciException:内部服务器错误:500:HTTP/1.1 OData方法:CREATE_ENTRY请求URI:POST HTTP/1.1请求标头:MessageId:空SAP_MplCorrelationId:AFtEXvgw-y5AWi82IdvYlUKemQfT SAP_Prepaid :AFtEXvgsOONB9mVBbLU7toerc0_N授权:基本********内容类型 :application/atom + xml接受:application/atom + xml x-csrf-token:******** Cookie:sap-usercontext = ********; 路径=/; MYSAPSSO2 = ********; 路径=/; 安全; HttpOnly; SAP_SESSIONID_LF4_081 = ********; 路径=/; 安全; HttpOnly; HTTP状态行:HTTP/1.1 500内部服务器错误响应标头:内容长度:227 sap-message:{"代码":" ODATA_ERROR","消息":"处理期间发生错误","严重性":"错误" ," target":""," details":[{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":"","严重性":"错误"} ,{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":""," severity":" error"}]} c4c-odata-response-time:572 ms ODataV2_Adapter_Response_Body: ERROR http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> ERROR xml:lang =" zh_cn"属性不存在::属性不存在 在com.sap.gateway.core.ip.component.odata.exception.LogHelper.handleException(LogHelper.java:202)处com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor.createEntity(OsciOdataRequestProcessor。 java:1818)位于com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor.cachehandling(OsciOdataRequestProcessor.java:3612),位于com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor。 createEntity(OsciOdataRequestProcessor.java:1639)... 27更多原因:com.sap.gateway.core.ip.component.odata.exception.OsciException:内部服务器错误:500:com.sap.gateway上的HTTP/1.1。 core.ip.component.odata.processor.OsciOdataRequestProcessor.logErrorPropagateException(OsciOdataRequestProcessor.java:3237)位于com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor.createEntity(OsciOdataRequestProcessor.java:1812)... 另外29个####### ERROR http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> ERROR xml:lang =" zh_cn"属性不存在::属性不存在

为了提高可读性,我在此处附加了日志:

messagelog-createprojec3-attachment-1-responsepayl .txt

我还尝试了"克隆"邮递员行为的方法:首先,我发送带有获取csrf tocken的get请求,然后发布我的数据,但响应也是http 500状态。

希望有人对此有一个答案。

最诚挚的问候,谢谢

克里斯托弗

(13.4 kB)

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

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


嗨,

我试图通过使用POST方法使用CPI Odata适配器和我通过SAP ByDesign Odata Modeller创建的给定OData服务来创建实体。

通过邮递员,我可以通过获取一个csrf令牌,然后发送一个发布请求来创建一个简单的实体。

通过CPI,由于遇到以下错误,我无法添加此实体:

com.sap.gateway.core.ip.component.odata.exception.OsciException:由:org.apache.olingo.odata2.api.edm.EdmSimpleTypeException引起:元数据不允许为空值。 在EntitySet ProjectCollection中,元数据不允许为属性" ObjectID"提供null值。

由于ObjectID是新对象的NodeID,因此在请求时我不知道该ObjectID。 通过邮递员,我不需要此字段。 我的请求正文在邮递员中看起来像这样:

{

" ProjectID":" ProjectID",

" TypeCode":" TypeCode",

" LanguageCode":" LanguageCode",

" ResponsibleCostCentreID":" ResponsibleCostCentreID",

" ProjectProjectSummaryTask":

{

" ResponsibleEmployeeUUID":" ResponsibleEmployeeUUID"

}

}

对于CPI中的映射,我使用从远程OData服务的odata向导创建的xsd,并将其推送到Odata适配器。

在堆栈跟踪下方:

com.sap.gateway.core.ip.component.odata.exception.OsciException:内部服务器错误:500:HTTP/1.1 OData方法:CREATE_ENTRY请求URI:POST HTTP/1.1请求标头:MessageId:null SAP_MplCorrelationId:AFtEXvgw -y5AWi82frvYlUKemQfT SAP_PregenicMplId:AFtEXvgsOONB9mVBbLU7toerc0_N授权:基本********内容类型:application/atom + xml接受:application/atom + xml x-csrf-token:******** Cookie:sap- usercontext = ********; 路径=/; MYSAPSSO2 = ********; 路径=/; 安全; HttpOnly; SAP_SESSIONID_LF4_081 = ********; 路径=/; 安全; HttpOnly; HTTP状态行:HTTP/1.1 500内部服务器错误响应标头:内容长度:227 sap-message:{"代码":" ODATA_ERROR","消息":"处理期间发生错误","严重性":"错误" ," target":""," details":[{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":"","严重性":"错误"} ,{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":""," severity":" error"}]} c4c-odata-response-time:572 ms ODataV2_Adapter_Response_Body: ERROR http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> ERROR xml:lang =" zh_cn"属性不存在::属性不存在 OData方法:CREATE_ENTRY请求URI:POST HTTP/1.1请求标头:MessageId:空SAP_MplCorrelationId:AFtEXvgw-y5AWi82frvYlUKemQfT SAP_PregenicMplId:AFtEXvgsOONB9mVBbLU7toerc0_N授权:基本******/atom内容/应用: + xml x-csrf-token:******** Cookie:sap-usercontext = ********; 路径=/; MYSAPSSO2 = ********; 路径=/; 安全; HttpOnly; SAP_SESSIONID_LF4_081 = ********; 路径=/; 安全; HttpOnly; HTTP状态行:HTTP/1.1 500内部服务器错误响应标头:内容长度:227 sap-message:{"代码":" ODATA_ERROR","消息":"处理期间发生错误","严重性":"错误" ," target":""," details":[{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":"","严重性":"错误"} ,{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":""," severity":" error"}]} c4c-odata-response-time:572 ms ODataV2_Adapter_Response_Body: ERROR http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> ERROR xml:lang =" zh_cn"属性不存在::属性不存在 在com.sap.gateway.core.ip.component.odata.exception.LogHelper.handleException(LogHelper.java:202)处com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor.createEntity(OsciOdataRequestProcessor。 com.sap.gateway.core.ip.component.odata.runtime.ODataClientProducer.process(ODataClientProducer.java:284)处的org.apache.camel.util.AsyncProcessorConverterHelper $ ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:java:1818) 61)在org.apache.camel.processor.SendProcessor $ 2.doInAsyncProducer(SendProcessor.java:173)在org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:341)在org.apache.camel.processor。 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:95)处的SendProcessor.process(SendProcessor.java:168)在com.sap.it.op.agent.collector.camel.MplInterceptor $ MplAsyncProcessor.process( MplInterceptor.java:180),位于org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.ja va:95)org.apache.camel.processor.RedeliveryErrorHandler.java:468(org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)org.apache.camel.processor org.apache.camel.processor的.Pipeline.process(Pipeline.java:121)org.org的org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)的Pipeline.process(Pipeline.java:83) org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)上的org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)在org.apache.camel.processor.DelegateAsyncProcessor上。 com.sap.it.op.agent.collector.camel.MplInterceptor $ MplAsyncProcessor.process(MplInterceptor.java:180)处的process(DelegateAsyncProcessor.java:95)org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor。 java:95),位于org.apache.camel.processor.Camel,位于org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468) org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)的InternalProcessor.process(CamelInternalProcessor.java:197)org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:44) 在org.apache.camel.processor.loadbalancer.LoadBalancerSupport.process(LoadBalancerSupport.java:97)的org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)处 org.quartz.core.JobRunShell.run(JobRunShell.java:202)的.CamelJob.execute(CamelJob.java:58)org.quartz.simpl.SimpleThreadPool $ WorkerThread.run(SimpleThreadPool.java:573)的原因 com.sap.gateway.core.ip.component.odata.exception.OsciException:内部服务器错误:500:HTTP/1.1 OData方法:CREATE_ENTRY请求URI:POST HTTP/1.1请求标头:MessageId:空SAP_MplCorrelationId:AFtEXvgw-y5AWi82IdvYlUKemQfT SAP_Prepaid :AFtEXvgsOONB9mVBbLU7toerc0_N授权:基本********内容类型 :application/atom + xml接受:application/atom + xml x-csrf-token:******** Cookie:sap-usercontext = ********; 路径=/; MYSAPSSO2 = ********; 路径=/; 安全; HttpOnly; SAP_SESSIONID_LF4_081 = ********; 路径=/; 安全; HttpOnly; HTTP状态行:HTTP/1.1 500内部服务器错误响应标头:内容长度:227 sap-message:{"代码":" ODATA_ERROR","消息":"处理期间发生错误","严重性":"错误" ," target":""," details":[{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":"","严重性":"错误"} ,{" code":" FCL_RUNTIME:023"," message":"属性不存在"," target":""," severity":" error"}]} c4c-odata-response-time:572 ms ODataV2_Adapter_Response_Body: ERROR http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> ERROR xml:lang =" zh_cn"属性不存在::属性不存在 在com.sap.gateway.core.ip.component.odata.exception.LogHelper.handleException(LogHelper.java:202)处com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor.createEntity(OsciOdataRequestProcessor。 java:1818)位于com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor.cachehandling(OsciOdataRequestProcessor.java:3612),位于com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor。 createEntity(OsciOdataRequestProcessor.java:1639)... 27更多原因:com.sap.gateway.core.ip.component.odata.exception.OsciException:内部服务器错误:500:com.sap.gateway上的HTTP/1.1。 core.ip.component.odata.processor.OsciOdataRequestProcessor.logErrorPropagateException(OsciOdataRequestProcessor.java:3237)位于com.sap.gateway.core.ip.component.odata.processor.OsciOdataRequestProcessor.createEntity(OsciOdataRequestProcessor.java:1812)... 另外29个####### ERROR http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> ERROR xml:lang =" zh_cn"属性不存在::属性不存在

为了提高可读性,我在此处附加了日志:

messagelog-createprojec3-attachment-1-responsepayl .txt

我还尝试了"克隆"邮递员行为的方法:首先,我发送带有获取csrf tocken的get请求,然后发布我的数据,但响应也是http 500状态。

希望有人对此有一个答案。

最诚挚的问候,谢谢

克里斯托弗

(13.4 kB)
1条回答
Climb_Ma
1楼 · 2020-09-16 11:21.采纳回答

可以自己修复。

我使用了2个请求来获取crsf令牌+ set-cookie值,然后创建了一个发布请求。 由于Byd odata api仍为v1(当前为v4),而hci使用最少的odata v2 api,因此HCI + BYD OData接口似乎无法一起使用。

一周热门 更多>