Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
22,115

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

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

    

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

                   

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

    

    • 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

         

         

         

          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.

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.

19 Comments