In this article I have share the steps to develop and test a Calculator Integration from scratch in Oracle Integration Generations 3 Instance | A complete Hands-on Practice.
Use Case - Develop an Integration which will be able to perform basic calculator operations i.e. (i.e. Addition ➕, Subtraction ➖, Multiplication ✖, Division ➗).
Prerequisite -
- OIC Generation 3 Instance Account
- Calculator Service WSDL URL: http://www.dneonline.com/calculator.asmx?WSDL
- Advertisement -
End Result
Once we complete the development of the Integration, final page looks as follow
Click on Image for better view |
and the Testing Page looks as shown in below image, where we will have four different operations i.e. Add, Subtract, Multiply and Divide to select...
Click on Image for better view |
The whole Article is divided into 3 Parts:
- Part 1 - I have mentioned the steps to Create Connection
- Part 2 - mentioned the steps to develop the Integration
- Part 3 - mentioned the steps to Test the Integration
Now Let's Start the development........
PART 1: Create Connection
STEP 1: Create REST Trigger Connection. Follow this Article to create the connection.
STEP 2: Create the SOAP Connection for the Calculator Service. Please follow this article to create the connection.
Once you have created the above two connections, Let's moved to Part 2 i.e. Develop the Integration.
PART 2: Create Integration
STEP 3: Create Integration.
- STEP 3.1: In the navigation pane, Click on Integrations (at left hand top). Click Create, then select Application.
- STEP 3.2: In the Name Filed, enter CalculatorApplication (you can enter any other meaningful name). Leave the other field as they are, click Create.
- Advertisement -
- STEP 3.3: Let's configure the REST Trigger connection to define how the Trigger connection receives messages in the integration
- Click on the ➕ icon and then search for REST Trigger Connection which we have created in Step 1. Select that connection.
- Enter "Calculate" as the endpoint name, Enable the “☑️ select to configure multiple resources or verbs " and then click Continue.
- Resource configuration page will get open. Enter the below information as suggested:
- Provide an Operation Name: enter add
- What is the endpoint's relative resource URI: enter /calculator/operation/add
- What action do you want to perform on the endpoint: select POST
- Select any options that you want to configure: select below options
☑️Configure a request payload for this endpoint☑️ Configure this endpoint to receive the response
Click Continue
- In the Request Page enter the following details
- Select the response payload format: Select JSON Sample.
- <<< inline >>>: Click this field and enter the following content, then click Continue.
{
"Number_1": null,
"Number_2": null
}
- Element: Ensure response-wrapper is selected.
- What is the media-type of Response Body: Ensure JSON is selected.
Click Continue
- let's configure the Response Page:
- Select the response payload format: Select JSON Sample.
- <<< inline >>>: Click this field and enter the following content, then click Continue.
{
"AddResponse": null
}
- Element: Ensure response-wrapper is selected.
- What is the media-type of Response Body: Ensure JSON is selected.
Click Continue
- Advertisement -
📝Note:
We have successfully configured the Request - Response page for ADD ➕ operation. Similarly, we have to configure the Request-Response page for the other operations - SUBTRACT ➖, MULTIPLY ✖, and DIVIDE➗. I will cover the detail steps with screenshots for one more operation i.e. for SUBTRACT ➖ and the rest two operations you can do it by yourself. Don't worry will provide the configuration details but no screenshots 😁
- Let's Configure Request - Response page for SUBTRACT operation (➖). Select "☑️Add Another operation" and then click Continue
Click on the Image for better view |
- Resource configuration page will get open. Enter the below information as suggested
- Provide an Operation Name: enter subtract
- What is the endpoint's relative resource URI: /calculator/operation/subtract
- What action do you want to perform on the endpoint: select POST
- Select any options that you want to configure:
☑️Configure a request payload for this endpoint☑️ Configure this endpoint to receive the response
Click Continue
- In the Request Page enter the following details
- Select the response payload format: Select JSON Sample.
- <<< inline >>>: Click this field and enter the following content, then click Continue.
{
"Number_1": null,
"Number_2": null
}
- Element: Ensure response-wrapper is selected.
- What is the media-type of Response Body: Ensure JSON is selected.
Click Continue
- Configure the Response Page:
- Select the response payload format: Select JSON Sample.
- <<< inline >>>: Click this field and enter the following content, then click Continue.
{
"SubtractResponse": null
}
- Element: Ensure response-wrapper is selected.
- What is the media-type of Response Body: Ensure JSON is selected.
Click Continue
Click on the Image for better view |
- We have successfully configured two operations - ADD➕ and SUBTRAT➖. Now I request you to configure the left two operations by following the same steps after clicking "☑️Add Another operation". Below I have provided the configuration details for both Multiply ✖ and Divide ➗ that you need to enter during configuration 😇
- Advertisement -
RESOURCE CONFIGURATION PAGE DETAIL:
- Provide an Operation Name: multiply
- What is the endpoint's relative resource URI: /calculator/operation/multiply
- What action do you want to perform on the endpoint: POST
- Select any options that you want to configure:
☑️Configure a request payload for this endpoint☑️Configure this endpoint to receive the response
REQUEST CONFIGURATION PAGE DETAIL:
- Select the response payload format: Select JSON Sample.
- <<< inline >>>: Click this field and enter the following content, then click Continue.
{
"Number_1": null,
"Number_2": null
}
- Element: Ensure response-wrapper is selected.
- What is the media-type of Response Body: Ensure JSON is selected.
RESPONSE CONFIGURATION PAGE DETAIL:
- Select the response payload format: Select JSON Sample.
- <<< inline >>>: Click this field and enter the following content, then click Continue.
{
"MultiplyResponse": null
}
- Element: Ensure response-wrapper is selected.
- What is the media-type of Response Body: Ensure JSON is selected.
RESOURCE CONFIGURATION PAGE DETAIL:
- Provide an Operation Name: divide
- What is the endpoint's relative resource URI: /calculator/operation/divide
- What action do you want to perform on the endpoint: POST
- Select any options that you want to configure:
☑️Configure a request payload for this endpoint☑️ Configure this endpoint to receive the response
REQUEST CONFIGURATION PAGE DETAIL:
- Select the response payload format: Select JSON Sample.
- <<< inline >>>: Click this field and enter the following content, then click Continue.
{
"Number_1": null,
"Number_2": null
}
- Element: Ensure response-wrapper is selected.
- What is the media-type of Response Body: Ensure JSON is selected.
RESPONSE CONFIGURATION PAGE DETAIL:
- Select the response payload format: Select JSON Sample.
- <<< inline >>>: Click this field and enter the following content, then click Continue.
{
"DivideResponse": null
}
- Element: Ensure response-wrapper is selected.
- What is the media-type of Response Body: Ensure JSON is selected.
- Once you have configured the other 2 operations click Continue. Below summary page will get generated. Click Finish.
- Advertisement -
STEP 3.4: We have successfully configured four operations in REST Trigger Adapter. Now let's add the Calculator SOAP Connection to invoke calculator service.
- Drag your cursor along the line until the Add icon appears. Select Invokes, then select the Calculator connection
- Configure Basic Info page opens, enter following details:
- What do you want to call your endpoint - Enter Addition
Click continue
- Configure Operations page appears. Enter the following information
- Select the Port - select CalculatorSoap
- Select the Operation - select Add
Click Continue
- Summary page appears. Review your selections, then click Done.
- Advertisement -
- Double Click the first map, i.e. Map Addition (request mapper)
- The mapper opens. In the Sources section, expand Add Request. In the Target section, expand Addition Request.
- Drag the source Number 1 element to the target intA element.
- Similarly drag the source Number 2 element to the target intB element
- Click Validate and wait for the Validation Successful message to popup.
- Click Back to exit the mapper and return to the integration canvas. Your mappings are automatically saved.
- Now Let's Map the second Mapper i.e. Map add (response mapper). Double click the mapper or select the mapper, right click and click Edit
- The mapper opens. In the Sources section, expand Addition Response. In the Target section, expand Response Wrapper.
- Drag the source Add Result element to the target Add Response element.
- Click Validate and wait for the Validation Successful message to popup.
- Click Back to exit the mapper and return to the integration canvas. Your mappings are automatically saved.
STEP 3.6: Define a Business Identifier
Let's now define the primary business identifier for this Scope.
- Click red error sign, then select Business Identifier . Expand Request Wrapper and drag Number 1 to the Business identifier field.
- Similarly drag Number 2 to the second Business identifier field.
- Click Save, then click outside the Business identifiers panel to close it. The business identifier you specify here is visible when you monitor your completed integration instance.
- We have successfully completed the configuration of ADDITION ➕ Operation; design looks as follows.
STEP 3.7: Add the Calculator Invoke Connection
- Select Port = CalculatorSoap , Operation= Multiply and then click Continue
- Summary page appears. Review your selections, then click Finish.
- Advertisement -
STEP 3.8: We have successfully configured the SOAP Invoke connection, now let's configure the mapper.
- Open the second mapper (i.e. Map Multiply) and complete the mapping (similar to above step 3.6).
- Refer below image
STEP 3.9: Define a Business Identifier (similar to above step 3.6)
- This way we have successfully configured the Multiplication Operation also.
- Now I request you to configure the left 2 operations i.e. SUBTRACT ➖ AND DIVIDE ➗ by yourself. You just need to keep in mind to select the correct operation while configuring the SOAP Connections of the left 2 operations.
- Choose Subtract for subtract operation and Divide for Divide Operations.
- Mapper will be similar to the above configured operations.
- Once you have completed the configuration of the left two operations (i.e. configured Invoke connection, Mapper and business identifier) Final Page looks like below image:
Activate and Run the Integration
- In Integrations section, click Power button ,
- Leave the tracing level set to the Production and the other options as they are and then click Activate.
- Click Refresh periodically. The integration status changes to Active. You are now ready to run the integration and send a message
{
"Number_1": 1,
"Number_2": 4
}
- View the response message at the bottom of the Configure and run page. The addition operation value is displayed
Congratulation! 👏👏You have successfully created, designed, activated, run, and monitored your First integration.
No comments:
Post a Comment
If you have any doubts, Please let me know.