How to configure/consume OData Service in SAP CPI

Estimated read time 4 min read

This blog will teach you how to consume OData service in an i-Flow also you can learn about OData/HTTP/SFTP adapter configuration & the utilization of XML to CSV converter in our i-Flow.

Introduction

You can develop OData APIs that expose existing data sources, such as SOAP, as OData endpoints. These OData APIs can be consumed by SAP Fiori apps, SAP BTP Mobile Services, or any other custom app, to implement user-centric scenarios –SAP help portal Developing an OData API Project 

 
OData Operations:
OData is a way of performing database-style create, read, update, and delete operations on resources through HTTP verbs – SAP Learning

Let’s start creating simple OData service
Here in this i-flow we are going to send request via HTTPS adapter using postman that request will be sent to OData service and the response that we get from OData service will be stored as a .csv file using SFTP adapter
 Step 1:
Configure HTTPS and SFTP adapters as per my previous blog 
Step 2:
 
Add request and reply pallet function in between Start and End message functions 
Step 3:
Take one more receiver from the Participant name it as ODATASERVICE and connect it to Request Reply using OData adapter with OData v2 protocol.

Step 4:

In this Flow we are going use below free OData service 
https://services.odata.org/v3/northwind/northwind.svc

Step 5:
In processing tab choose Resource path click on Select & click on step 2 and select the entity as per your requirement in this blog I am selecting Employees as shown below

-select the Operation as Query as we are fetching the Employee Details.

After selecting the Entity select all the fields as shown below an d click on finish so that it will automatically generate a Query


 

Step 6:
Now I am adding XML to CSV converter to convert the response data that we get from OData service and to send .csv file to the target system

Finally save and deploy the i-flow and trigger the data from Postman to check the result


If you look at the above screenshot we have successfully received response of Employees data from OData service and converted to csv format.

Please feel free to post a query in the comments section if you have any inquiries.

Thank you and Happy Integrating

 

 

 

 

 
 

 

 

 

​ This blog will teach you how to consume OData service in an i-Flow also you can learn about OData/HTTP/SFTP adapter configuration & the utilization of XML to CSV converter in our i-Flow.IntroductionYou can develop OData APIs that expose existing data sources, such as SOAP, as OData endpoints. These OData APIs can be consumed by SAP Fiori apps, SAP BTP Mobile Services, or any other custom app, to implement user-centric scenarios -SAP help portal Developing an OData API Project  OData Operations:OData is a way of performing database-style create, read, update, and delete operations on resources through HTTP verbs – SAP LearningLet’s start creating simple OData serviceHere in this i-flow we are going to send request via HTTPS adapter using postman that request will be sent to OData service and the response that we get from OData service will be stored as a .csv file using SFTP adapter Step 1:Configure HTTPS and SFTP adapters as per my previous blog Step 2: Add request and reply pallet function in between Start and End message functions Step 3:Take one more receiver from the Participant name it as ODATASERVICE and connect it to Request Reply using OData adapter with OData v2 protocol.Step 4:In this Flow we are going use below free OData service https://services.odata.org/v3/northwind/northwind.svcStep 5:In processing tab choose Resource path click on Select & click on step 2 and select the entity as per your requirement in this blog I am selecting Employees as shown below-select the Operation as Query as we are fetching the Employee Details.After selecting the Entity select all the fields as shown below an d click on finish so that it will automatically generate a Query Step 6:Now I am adding XML to CSV converter to convert the response data that we get from OData service and to send .csv file to the target systemFinally save and deploy the i-flow and trigger the data from Postman to check the resultIf you look at the above screenshot we have successfully received response of Employees data from OData service and converted to csv format.Please feel free to post a query in the comments section if you have any inquiries.Thank you and Happy Integrating           Read More Technology Blogs by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author