cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPI - OData receiver adapter- Entity Set not found in the edmx.. error

smitha_gatty
Explorer
0 Kudos

hi All,

I am trying to post data to OData service on SAP backend system using OData receiver Adapter in a SAP CPI Integration flow. I get the error "com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: Request Payload Parsing Failed for one of the reason: (1) Either the OData metadata content available in the server is outdated OR (2) The request payload seems to be incorrect. Error Details : Entity Set Shipment not found in the edmx.."

What could be the reason for the same?

The incoming payload is in JSON format which is converted XML in the flow, and a XSLT mapping is used to remove the root node added during conversion. the generated XML is then fed to OData adapter.

We have tested the payload in gateway and we get '201' response.

The XML payload being sent to OData adpater-

<?xml version="1.0" encoding="UTF-8"?><Shipment>Z</Shipment><shipperRefDocuments><docId>00</docId><shipment_id>bkk</shipment_id><docType_code>73</docType_code></shipperRefDocuments><shipperRefDocuments><docId>009</docId><shipment_id>bkkj</shipment_id><docType_code>73</docType_code></shipperRefDocuments><eta>2023-03-20T15:21:31Z</eta><actualTechnicalTimestamp>2023-02-15T15:21:37.132Z</actualTechnicalTimestamp><logicalSystem>C</logicalSystem><transportationMode_code>01</transportationMode_code>

JSON file expected at backend SAP system

{

"Shipment":"Z",

"shipperRefDocuments":[

{

"docId":"00",

"shipment_id":"bkk",

"docType_code":"73"

},

{

"docId":"009",

"shipment_id":"bkkj",

"docType_code":"73"

}

],

"eta":"2023-03-20T15:21:31Z",

"actualTechnicalTimestamp":"2023-02-15T15:21:37.132Z",

"logicalSystem":"C",

"transportationMode_code":"01"

}


Integration flow - screenshot

Any input is much appreciated.

View Entire Topic
PriyankaChak
Active Contributor

Hi Smitha,

The XML payload that you are sending to ODATA adapter does not have the root tag.

Create XSD structure from EDMX and check the required root tag name.

Use the same root tag name while sending data to ODATA adapter.

Regards,

Priyanka

smitha_gatty
Explorer
0 Kudos

hi Priyanka,

I did try to generate the XML according to the generated xsd from EDMX, but this creates extra root tags which is not expected at the SAP backend system. Is there a way to avoid the same before sending it to backend?

PriyankaChak
Active Contributor
0 Kudos

Can you check with your backend system if the JSON payload is having those highlighted tags after a trial run?