Skip to Content

POST Operation using OData Adapter in HCI

Dear All.

I'm using Odata adapter in receiver end,

and the oData receiver channel configuration

in content modifier payload is

when i execute the flow getting below error.

LastError = com.sap.gateway.core.ip.component.odata.exception.OsciException: Bad Request : 400 : HTTP/1.1 http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> xml:lang="en">Must be an entity set instead of an entity: 'Invoices'. , cause: com.sap.gateway.core.ip.component.odata.exception.OsciException: Bad Request : 400 : HTTP/1.1 http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> xml:lang="en">Must be an entity set instead of an entity: 'Invoices'.

but when i execute the same payload the REST API client tool it's posted successfully,

same payload : REST API client tool result.

may i know why i 'm getting an above error. do we need to go for client certificate authentication since my target url is https?

Regards

Ramesh

1.png (19.9 kB)
2.png (27.4 kB)
3.png (20.5 kB)
3.png (28.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Nov 25, 2016 at 09:55 AM

    Hello Ramesh,

    Its better to have one to one mapping after content modifier to avoid issues w.r.t input payload.

    You can use the XSD in mapping which is generated using Model operation of the OData Channel for the Entity to which you are trying to POST the data.

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 25, 2016 at 09:50 AM

    Hi Ramesh,

    Seems the payload is the culprit. can you check on that part.

    Regards,

    Vijay

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 25, 2016 at 10:03 AM

    Yes Ramesh,

    You can use the last XSD ending with ***POST4.These XSDs are generated when you finish your model operation.

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

    • you mean, if i send the xml using mapping (target xsd is ***POST4) to Odata adapter the message can be processed, not require this content modifier?

  • Nov 25, 2016 at 10:18 AM

    Hello Ramesh,

    Content Modifier is required. Mapping is required just to make sure your message sent to target server as per the structure its looking for.

    In many cases when when manually create XML structure there are chances of issues w.r.t. data or format just to avoid that we will use mapping.Adding mapping is just to ensure message is not getting failed because of your input XML.

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks for your clarification.

      now message mapping error ..

      LastError = com.sap.xi.mapping.camel.XiMappingException: com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot produce target element /Invoices. Queue has not enougth values in context. Target xsd requires a value for this element, but target field mapping does not produce one. Probably the xml-instance is not valid to the source xsd, or the target field mapping does not fulfill the requirement of the target xsd., cause: com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot produce target element /Invoices. Queue has not enougth values in context. Target xsd requires a value for this element, but target field mapping does not produce one. Probably the xml-instance is not valid to the source xsd, or the target field mapping does not fulfill the requirement of the target xsd.

      because .

      content modifier payload is

      by my XSD structure is (exported from HCI and import ESR)

      i can see both structure is different. how can we send as for payload which is placed in content modifier if i use the message mapping.

      fyi. content modifier payload if i place in API it's posting successfully

      Regards

      Ramesh

      1.png (24.2 kB)
      2.png (26.3 kB)