Exploring Cloud Integration - Part 9 (Creating a Request and Reply to an external Call (HTTP Call))

Exploring Cloud Integration - Part 9 (Creating a Request and Reply to an external Call (HTTP Call))

In the last article I set up a router with two routes. If the productID is not found in the database, the process must be terminated in one of the routes. If the ProductID is found, further processing steps will take place in the other route.

The objective of today's article is to retrieve the relevant line items for each productID. This is because in order to read the Customer ID during a subsequent call, I will require the SalesOrder ID and ItemPostion for each productID.

To achieve the above objective, I will create and configure an external HTTP adapter for the request and reply call.

Task Flow

I performed the following tasks:

  1. Logging on to the integration flow DelayedDelivery_Process.
  2. Creating a request and reply to external HTTP call.
  3. Saving as version, deploying, and debugging the integration process.

Prerequisites

The creation and configuration of a Router has been completed in the last article.

Outcome After This Exercise

Article content
Figure 176: Outcome of today's exercise

Environment

Live SAP BTP account.

Task 1: Logging on to the Integration Flow DelayedDelivery_Process

Steps

  1. Logged on to the integration flow DelayedDelivery_Process via Integration Suite.

  • Navigated within the Integration Suite Welcome page to DesignIntegrationsDelayedDelivery_Package_randomNumberDelayedDelivery_Process.
  • Checked the status after the last exercise step:

Article content
Figure 177: Outcome of last exercise

Task 2: Creating a Request and Reply to an External HTTP Call

Steps

  1. Expanded the workspace.

  • I worked on the ProductID_Available route.

Article content
Figure 178: Expanding the workspace

2. Set a second Receiver component.

  • I added a Receiver component.

Article content
Figure 179: Adding a Receiver component

  • Renamed the receiver to API_SalesOrder_ProductSet_ToSalesOrderLineItems.

Article content
Figure 180: Renaming the receiver to

3. Added a CallExternal CallRequest Reply.

  • I manually arranged the components to create a visually pleasing flow.

Article content
Figure 181: Adding an External Call

  • Changed the name to Call_fetchLineItems.
  • Again, I dragged the arrow from the context menu of the:

. 〰 Call_fetchLineItems to

〰 API_SalesOrder_ProductSet_ToSalesOrderLineItems

Article content
Figure 182: Dragging the arrow from the context menu

  • Selected the HTTP adapter.
  • I selected the HTTP connection line and accessed the connection tab to configure the adapter. Once again, I used the Simple Expression Language to read the Exchange Property.

Table 15: HTTP adapter connection tab data

Article content
Article content
Figure 183: Configuring HTTP adapter

4. Verified the number of available data records.

  • In the browser tab, I entered my URL and replaced ${property.ProductID} with HT-1000.

https://< My API Host >/ProductSet('${property.ProductID}')/ToSalesOrderLineItems/$count        

  • There were 1400 data records available for the ProductID "HT-1000".

Task 3: Saving as Version, Deploying, and Debugging the Integration Process

Steps

  1. Saved as version, deployed, and debugged the integration process.

  • Performed the following steps:

〰Save as version.

〰Deploy.

〰Jump to OverviewManage Integration Content.

〰Set log level to trace.

〰Deploy again.

〰Jump again to OverviewManage Integration Content.

  • Navigated to the Integration Flow Model in OverviewMonitor Message ProcessingMessage Processing Run.

Article content
Figure 184:

  • A ProductID was being processed.
  • Chose the End event step at the Message Content tab and at the Payload link.

Article content
Figure 185:

  • I noticed that the payload was too large, as it contained 1400 data records.
  • I used the following URL to retrieve only two data records using the "&$top=2" query parameter, and replacing ${property.ProductID} with HT-1000.

https://< My API >/ProductSet('${property.ProductID}')/ToSalesOrderLineItems/?&top=2        
Article content
Figure 186: Retrieved only two data records

  • The result was a feed with name spaces. I was interested in the values under /Content/m:properties/SalesOrderID and /Content/m:properties/ItemPosition.

Article content
Figure 187: SalesOrderID and ItemPosition.

Conclusion

Retrieving the relevant line items for each productID is a crucial step in enabling seamless data flow for subsequent calls. By configuring an external HTTP adapter for request and reply call, I ensured that the necessary details such as the SalesOrder ID, and ItemPosition are available for further processing.

Next Article ▶

In the next article, I will create an XSLT Mapping which removes the namespaces from the payload, enabling access to the values using XPath expressions.

Previous Article ◀

Creating and Configuring a Router

Thanks for reading !

Reference

SAP (2024). Developing with SAP Integration Suite

© 2024 SAP SE or an SAP affiliate company. All rights reserved. This article references SAP materials for educational purposes, in accordance with SAP's copyright guidelines.


To view or add a comment, sign in

More articles by Joseph Ogunronbi

Insights from the community

Others also viewed

Explore topics