on 2019 May 28 12:08 PM
Dear Experts,
I'm trying to post LeadCollection data from SAP CPI to SAP C4C using ODATA call. This works well when i do test connection in SAP C4C and when I post data from POSTMAN tool. However when I pass the same XML or JSON payload from CPI it does give me a parsing error. Please give me your inputs to fix this issue.
The URL is as below:
https://XXXX.com/sap/c4c/odata/v1/c4codataapi/LeadCollection
Also I get parsing error for both XML and JSON which one I should use?
When I use JSON payload:
Error Details
com.sap.gateway.core.ip.component.odata.exception.OsciException: 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 : only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1) , org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1) Request Payload : { "ObjectID": "1234", "AccountCountry": "SK", "AccountPartyID": "1000976", "Company": "RodičovskézdruženiepriMŠ2771",
When I use XML payload:
Error Details
com.sap.gateway.core.ip.component.odata.exception.OsciException: 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 entry not found in the edmx.
Request Payload :
<?xml version="1.0" encoding="utf-8"?>
<entry m:etag="W/"datetimeoffset'2019-05-24T13%3A02%3A44.8187640Z'"" xml:base="https://XXX/sap/c4c/odata/v1/c4codataapi/" xmlns="http://www.w3.org/2005/Atom"
It would be helpful if you give some suggestions to move further on this.
Regards,
Vidhya Nizamkar
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hi Vidhya
If you are using the OData adapter, your payload needs to be in XML format, and specifically adhering to the schema generated by the OData Query Wizard (that can be invoked from the Processing tab of the OData channel) for your POST operation. This replaces the OData Operations Modeler that was previously available via Eclipse.
The OData adapter automatically transforms the payload to Atom XML before calling the endpoint, so you cannot use the Atom XML (that you use directly from Postman) as the input to the adapter.
Regards
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Vidhya,
The error shows there is a problem with your OData service metadata. If this created manually, can you please check if all the fields are in sync with the data posting to service. Also, try reloading metadata and test.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
11 | |
8 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.