Skip to Content

OData Protocol

OData is an open standard protocol that allows service providers to define access to their resources in a standardized manner. The service definition is available via the service metadata document (EDMX).

OData allows resources (Entity Sets) to be identified using Uniform Resource Identifiers (URIs) and defined in an abstract data model.

E.g. If the user wants to access Employee with primary key as 1, the details of the URI would be http://<server name>/<service name>/Employees(1) with the HTTP GET operation

The data format for exchange is ATOM XML or JSON

What makes the OData protocol very flexible is the availability of associations which defines the relationship between Entity Sets. For example, Let us say when retrieving Employees you would also like to get information about their HR and if this (HR) is defined as an association then this is possible in one single call and also directly by modifying the URI appropriately.

More details about OData protocol at http://www.odata.org/

OData Adapter in HCI

With the OData Adapter available in the Receiver channels of HCI you can connect to any OData service provider and perform the required operation required for your integration scenario. The HCI platform provides full pipeline capability also when using the OData Adapter. When data is fetched from the OData Service either in ATOM-XML or JSON format, the Adapter automatically converts this to XML and the payload can be used with any of the steps (e.g. mapping) available in the platform. Similarly, when sending data back to the OData service via the PUT or POST operation, the data is converted back from XML to JSON or ATOM-XML format automatically by the Adapter.

The OData Adapter in HCI supports the v2 version of OData Protocol.

OData Adapter Settings

1. OData Adpater General.jpg

2. Adapter Specific.jpg

Some key features

  1. The Adapter currently supports both Basic and Certificate Based authentication to the OData service.
  2. It allows you to specify a Page Size. This feature is useful in case the OData Service that you are connecting to has problems with large payload size. Using Page Size the Adpater fetchjes data in smaller chunks from the OData Service (Internally uses the top and skip operations)
  3. For Integration developers who do not know the complete symantics of OData protocal or the OData service, there is a simple easy-to-use Operations Modeler. The Operations Modeler parses through the service definition in the edmx and allows users to define the URI and operations via a wizard. The Modeler also generates an XSD file, which is the metadata of payload received or to be sent. This XSD can be used in further steps like mapping.

OData Operations Modeler

  • Connect to the OData service to download the edmx OR upload the edmx of the service to src.main.resources.edmx and use it in the Modeler

     3a Operations Modeler Connect.jpg

  • Choose the Entity on which you would like to perform the required Operation. In case you would like to also select the Associated Entities via then choose the levels.

          3. Operations modeler Enityt select.jpg         

  • Decide on the operation and fields that you need to work on.

     4. Operations Modeler - Operation.jpg

    • In case of Query operation you can also decide to use top and skip
    • In case of Read, Merge and Update the mandatory Key fields are automatically populated.
    • In case of Create, Update and Merge operations the Adapter also supports batch requests. OData batch request allows you to send multiple records / operations in one single request as batchsets. The Operations Modeler ensures that the XSD that is generated is defined in a format that allows sending of batch records. For more details read Note 2031746
  • In case of Query Operation you can filter and sort the dataset

          5. Operations Modeler - Filter.jpg

          6. Operations Modeler - Sort.jpg

         

          The filterable and sortable fields are prefilled thereby allowing to simply model the operations.

  • Clicking on finish generates the XSD file which is the format of data exchange and this can be used further in steps like Mapping.

Note: You can access some test services from http://services.odata.org/

OData Support in SuccessFactors Adapter

SuccessFactors also exposes API as OData services apart from SOAP based services. The SuccessFactors Receiver Adapter is enhanced to also support the OData based services.

7. SFSF OData General.jpg

By using the OData V2 proptocol as the Message Protocol in the SuccessFactors Adapter you can connect and work with OData services exposed by SuccessFactors. SuccessFactors OData follows the same open standards thereby all of the information mentined above is also applicable for SuccessFactorsOData Service.

SuccessFactors OData service does not have support for batch operation. Instead what is supported is a custom OData import function called UPSERT. The UPSERT operation takes care of creating or updating the records without you having to do this explicitly. The UPSERT operation also allows sending of multiple records at the same time.

9. SFSF OData - Upsert Modeling.jpg

To report this post you need to login first.

16 Comments

You must be Logged on to comment or reply to a post.

  1. Arijit Das

    Hi Sabarish

    Great blog; thank you for taking the time to author it!

    We have a question. Why doesn’t the OData adapter have a Sender channel?

    Our requirement is – an application will call a OData service in SAP PO, SAP PO will then poll SuccessFactors (using the SFSF OData Receiver adapter); and SAP PO will send the data back to the calling application.

    Application X to SAP PO to SF to SAP PO to Application X.

    Regards

    Arijit

    (0) 
    1. Sabarish T S Post author

      In HCI the Sender Channel is used in 2 cases

      1) For polling content from some external system – > SFTP, SFSF

      2) Listner for incoming payload i.e. exposing a service endpoint -> SOAP

      In case of the OData Adapter it does not do both the above. It can be used to connect to an already exisiting OData Service and do the required oprerations.

      You seem to be talking about SAP PO. The blog focuses on the HCI capability that is available at present.

      In your use case I think you are trying to expose an OData service. Please contact me at sabarish.t.s@sap.com and we can discuss on this specific use case separately.

      (0) 
  2. Parag Jain

    Hello Sabarish,

    How does one use value from the request and pass it to Odata query operation ?

    For e.g. i have a SOAP to OData scenario, i would like to list Sales Orders for a customer and would like to pass the customer number in the SOAP request, this is passed to the OData Query and the response is mapped back.

    In the example above, you have hard coded Freight = 21, if this needs be taken from the request message, how would we do that.

    Hope i was able to explain my query.

    Regards,

    Parag.

    (0) 
    1. Sabarish T S Post author

      You can use a Content Modifier step as assing the value that is coming from the SOAP message to a header field.

      In the query modeler in the “Configure filter condiiton for fileds’ choose Input type as header and mention the header name.

      If you want more flexibility in the Adapter Query section you can hand type the OData Query and can use the header filed in any sections of the Query.

      (0) 
      1. Parag Jain

        Thank you, this is quite helpful. What would be the syntax ?

        For e.g. the field name in request is “CustomerNo”, in the content modifier, i would have a header field called “customer”, type = XPATH , Value = ?

        Similarly, in the Odata query, i would like to have $filter=CustomerNo eq (?)

        I am unable to find documentation on this syntax hence asking for details.

        Regards,

        Parag.

        (0) 
        1. Sabarish T S Post author

          If you use property then $filter=CustomerNo eq ‘${property.nameofproperty}’

          If you use header then $filter=CustomerNo eq ‘${header.nameofheader}’

          (0) 
          1. Parag Jain

            Thank you Sabarish, this is clear.

            In Content Modifier, what would be the syntax for assigning header or property to the field name in the request payload ? For e.g. the request payload is as follows

            <request>

              <Customer>

                <CustomerNo> 4711 <CustomerNo>

              </Customer>

            </request>

            If I would like to use header or property and assign <CustomerNo> tag, what would be the syntax.

            nameofheader , XPATH / java.lang.String,  Value = ?

            Regards,

            Parag.

            (0) 
            1. Parag Jain

              This is solved. When using XPATH, the tool provides a value help to select the element. Used that and also inserted the namespace mapping in “runtime configuration” tab of the iFlow.

              (0) 
  3. farooq ahmed

    Hi Sabarish,

    I am trying a SOAP-to-OData Scenario ,in which we are trying to post to the OData.After configuring the receiver OData Channel ,after selecting the Operation: Create(POST) and deploying the iFLow, We are facing the following error:

    com.sap.gateway.core.ip.component.odata.exception.OsciException: Request Payload: Either the OData metadata content available in the server is outdated or the request payload seems to be incorrect = https://<tenandtid>/Automation/AP/XSOData/TestEntry.xsodata_defaultTenant with error => No such entity found in the edmx

    P.S : But in the EDMX file i am able to see the metadata content of the OData service.Also when we post the data from the POSTMAN to the table.

    Hope i was able to explain my query.It would be helpful if you can guide how to add metadata content.

    Regards
    Farooq

    (0) 
  4. Sidharth Mehta

    if we are using sftp to odata scenario, picking csv from sftp, mapping not required and in odata we want payload in json, so we have to add csv to xml convertor and xml to json convertor before odata adaptor or just sftp adaptor and odata adaptor and in odata payload format select json without using convertors.

     

    (0) 
  5. Amitabh Dubey

     

    Thanks Sabrish for this informative blog. I am OData adapter to fetch messages from IoT in SCP and intend to convert the same into an IDoc for further processing in ECC (via HCC) however I am not able to figure out how can we do this.

     

    Thanks a lot for your help.

    Regards

    Amitabh

    (0) 

Leave a Reply