Quantcast
Channel: Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 741

Batch Request in SAP HCI OData Adaptor

$
0
0

Everyone knows what is OData protocol - It is for accessing diverse data in a common way. With OData adaptor in HCI you can connect any OData service provider and perform the required integration scenario.

 

In this blog I am explaining how to do a batch request with multiple operations on different OData collections.

 

If you are new to OData adaptor read this blog: OData Adapter in SAP HANA Cloud Integration

 

An OData batch request allows you to execute multiple operations in a single HTTP request.


Let's take an example.

  • Assume that you have two OData collections - Products and SalesOrders.
  • You should be able to do a batch with multiple operations as given below.

     2016-03-23_10-34-51.jpg


  • But, if you are using OData adaptor, you will find that you don't have an option to choose multiple OData collections as given below.

 

     2016-03-23_10-23-48.jpg

     2016-03-23_10-24-25.jpg

  • It doesn't mean that HCI is not stopping you from doing a batch request with multiple operations on different OData collections.

 

  • The solution is to send the batch request in the payload irrespective of what you configured in the model operation.
  • To show you how it works I have created a simple iFlow. (I am not going to the basics of creating an iflow, if you are new to HCI read this blog)

     2016-03-23_10-39-06.jpg

  • I have two OData collections - Products, SalesOrders.
  • In my batch request I want to create a Product and a SalesOrder.

     2016-03-23_13-19-49.jpg

  • Hence the equivalent batch request payload to be used in HCI content modifier body is given below.

     2016-03-23_13-33-07.jpg

  • For your reference the I have attached the body used in the postman rest client, download it here.

 

  • The format of the batch request body to be used is given below.

     2016-03-24_08-36-06.jpg

  • The details for the payload could be taken from the metadata of OData service.
  • Given below I have highlighted entitySetName and entityTypeName in my metadata.

     2016-03-23_13-44-01.jpg

  • If your backend is an on premise system (ex. SAP Gateway) you need to configure HANA Cloud Connector with your HCI as mentioned in this blog.

 

  • In the adaptor settings the address should be referring to your virtual host and port configured in HCC. And the Proxy Type should be On-Premise.
  • Choose a model operation with batch processing enabled. The Odata collection chosen could be independent of the batch payload we are using.

    2016-03-23_13-57-33.jpg

  • Now we could deploy the project and see how the two create operations (create product and create salesorder) worked through a batch request.

 

     2016-03-22_20-19-02.jpg

 

Regards, Midhun

SAP Technology RIG


Viewing all articles
Browse latest Browse all 741

Trending Articles