on 2020 Sep 23 5:37 PM
Hi Experts,
While calling an OData service in C4C from CPI, we are having issues. it is a simple iflow where we are receiving JSon payload using HTTP and we want to post it to C4C. we tried calling Odata service using odata and HTTP both. C4C service itself is working as we can see from postman, so issue is while calling from CPI.
While using HTTP method to call the OData service, we are getting bad request error.
If we use Odata, we get below 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 : 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)"
Found this answer where Eng says that we cant use JSON with Odata adapter but i am not sure how to go about using xml for a c4c web-service.
https://answers.sap.com/questions/12697667/creating-leadcollection-via-odata-in-sap-c4c-using.html
Any Help is appreciated.
Thanks,
Hemant
Request clarification before answering.
Hi Hemant,
OData adapter in CPI expects a plain XML as input. You can check the details on payload structure in the following blog post.
The adapter also provides wizard that can help you generate the necessary XSD scheme. Refer the following blog.
https://blogs.sap.com/2018/04/10/sap-cloud-platform-integration-odata-v2-query-wizard/
So if your incoming request is a Json payload, you can use a JSON to XML converter followed by Message Mapping to create the necessary payload.
Best regards,
Prasanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
63 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.