cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPI ODATA V2 POST request Issue

loganathanhci
Explorer
0 Kudos

Hello Experts,

When I am creating a interface from 3rd party to C4C (ODATA v2) service in CPI in JSON format. There are standard ODATA JSON format provided by SAP. Using that I am trying to create a customer in C4C. Passed the JSON structure in the content modifier and used a request reply to hit odata IndividualCustomerCollection service at C4C.

I am getting an error:

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)

Data in content modifier:

{"CustomerABCClassificationCode":"A","Phone":"+1 888-888-88","Email":"jane.green@mail.con","Fax":"+1 0012346001234","City":"Greenville","CountryCode":"US","HouseNumber":"1","Street":"Greenway Drive","StreetPostalCode":"34001","RoleCode":"CRM000","GenderCode":"2","LanguageCode":"EN","LastName":"Green","TitleCode":"0001","FirstName":"Jane","StateCode":"AZ"}

Is JSON format is not allowed hit ODATA via CPI? Can't use a standard way for this ? we need to use only enable batch processing to achieve this ?

Waiting for the reply. Thanks

View Entire Topic
jacko123
Explorer
0 Kudos

Same issue here. We need to use patch, which HTTP adapter doesn't have. Also need to send in JSON not XML due to issues transforming the data in XML.

jacko123
Explorer
0 Kudos

https://blogs.sap.com/2022/02/04/send-patch-method-with-http-adapter-on-cpi/

Heres an article that helped overcome this problem.