Skip to Content

SAP CPI ODATA V2 POST request Issue

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Dec 11, 2018 at 03:49 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 11, 2018 at 04:55 PM

    Hi Raju,

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

    Best regards
    Jürgen

    Add comment
    10|10000 characters needed characters exceeded

    • 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?

  • Dec 13, 2018 at 10:39 AM

    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?

    Add comment
    10|10000 characters needed characters exceeded

    • 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...