cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP CPI ODATA V2 POST request Issue

loganathanhci
Explorer
0 Likes
11,341

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

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member

Hi Raju,

I think the problem is that you are trying to send a JSON message via OData Adapter. This won't work from my point of view. The OData Adapter always needs XML data as input.

BR

Maik

jacko123
Explorer
0 Likes

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 Likes

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

Heres an article that helped overcome this problem.

awaes59
Explorer
0 Likes

Hello

How did you proceed ? I have the same issue here, please help us

former_member403260
Discoverer
0 Likes

Hello

How did you proceed ? I have the same issue here, please help us.

loganathanhci
Explorer
0 Likes

Hi All,

Thanks for the quick reply..

ODATAv2 service can also be used in the HTTP adapter? How both are differentiated? As SAP is deprecating ODATA v2 and A2X (SOAP-Sync) service. Earlier it is SOAP to SOAP call, So we preferred to make both source and target as ODATA call. In this case there may be no change at CPI side. Any suggestions on this?

ananda_paul
Explorer
0 Likes

Hi Raju,

Did you find a way to fix this? I am also getting the same error when sending JSON data in SuccessFactors adapter. I tried to post the json message in HTTP adapter, but the request is not posted.

Regards,

Anand...

jravnik
Participant
0 Likes

Hi Raju,

you could use a HTTP adapter, if you need to use JSON format.

Best regards
Jürgen

loganathanhci
Explorer
0 Likes

Hi All,

Thanks for the quick reply..

ODATAv2 service can also be used in the HTTP adapter? How both are differentiated? As SAP is deprecating ODATA v2 and A2X (SOAP-Sync) service. Earlier it is SOAP to SOAP call, So we preferred to make both source and target as ODATA call. In this case there may be no change at CPI side. Any suggestions on this?

satheshM
Explorer
0 Likes

is that Anyone find out the solution for this 

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)