Oracle Integration Cloud Service: Lab Guide - Integration With Rest Webservice

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Oracle Integration Cloud Service

Lab Guide – Integration with REST WebService

Page 1 of 25
Contents
Prerequisites ........................................................................................................................................................................... 3
Objectives................................................................................................................................................................................ 3
Introduction to the REST Request ........................................................................................................................................... 3
Create the REST based connection ......................................................................................................................................... 4
Define the Source Application ................................................................................................................................................ 8
Define the Target Application ............................................................................................................................................... 13
Specify the Request Mapping ............................................................................................................................................... 16
Specify the Response Mapping ............................................................................................................................................. 17
Add Tracking ......................................................................................................................................................................... 19
Activation .............................................................................................................................................................................. 20
Test Using SOAP UI................................................................................................................................................................ 21
Summary ............................................................................................................................................................................... 25

Page 2 of 25
Prerequisites
There are no prerequisites to this lab.

Objectives
In this lab, you will configure a REST adapter that will connect to Sales Cloud. You will then use the adapter in
integration.

Introduction to the REST Request

Here is a sample REST request from Sales Cloud

https://crm-
aufsn4x0ala.oracleoutsourcing.com/crmCommonApi/resources/latest/accounts?onlyData=true&fields=OrganizationNa
me&orderBy=OrganizationName&limit=200&q=OrganizationName LIKE L*

One can execute this Request in a REST tester, such as SOAP UI. You need to add the Oracle Sales Cloud credentials for
Authorization.

Get the Oracle Sales Cloud Credentials from the Integration Labs Environment Details page.

Essentially, this returns customers whose name begins with “L“.

This output has been saved to a file, which you will use later on in this lab.

Name the file SampleSalesCloudResponse.txt

Page 3 of 25
Create the REST based connection
1. From the Home page Click Create Connections

2. Click on Create

3. Search for REST and select the REST adapter

4. Enter the connection name. Use the following naming conventions.

Field Action

Connection Name Enter value

SalesCloudREST <ClassID> <StudentID>

e.g. SalesCloudREST 06 26

Page 4 of 25
Identifier Nothing to enter.

Automatically generated from the connection name:


SalesCloudREST_<ClassID>_<StudentID>

e.g. SALESCLOUD_96_06

Version Nothing to enter.

Use the default value of 01.00.0000.

Connection Role Trigger and Invoke

After configuration the page appears as below.

5. Click Create
6. Click Configure Connectivity. Select Connection Type as REST API Base URL

Get the Oracle Sales Cloud REST URL from the Integration Labs Environment Details page.

Page 5 of 25
7. Click OK
8. Click Configure Security, select Security Policy as Basic Authentication.

Get the Oracle Sales Cloud REST Credentials from the Integration Labs Environment Details page.

9. Click OK
10. Test the Connection and then click on Save and click on Close.

Page 6 of 25
Create the Integration

1. Click on Integrations

2. Click on Create
3. On “Create Integration – Select a Style/Pattern” dialog click Select Map Data

4. Provide the following information:

Field Enter

Name OSC REST Get Accounts <ClassID>


<StudentID>

Page 7 of 25
e.g. OSC REST Get Accounts 06 26

Identifier Nothing to enter. The value is automatically


generated from the integration name:

OSC_REST_GET_ACCOU_06_26

Version Nothing to enter.

Use the default value of 01.00.0000.

Package Name Nothing to enter.

5. Click Create.

Define the Source Application


1. Drag the REST connection from the Connections palette to the Source area.

Page 8 of 25
2. You will see the following careen

3. Provide the following information and click Next :

Field Enter

What do you want to call your connection? GetAccounts

Page 9 of 25
Relative resource URI /accounts

action GET

Add and review parameter for this Checked


endpoint

Configure this endpoint to receive the Checked


response

The page should look like this….

4. Click Next. Provide the following resource parameters, then click Next:

Parameter Type

onlyData boolean

fields string

orderBy string

Limit integer

q string

Page 10 of 25
5. The next page allows us to configure the response payload. This will be based on the file –
SampleSalesCloudResponse.txt

Page 11 of 25
6. Select JSON Sample and payload type JSON. Then click the Choose File button to select
salesCloudRESTResponse.txt

Once the file is selected, the Element value, response-wrapper appears.

Note: Sometimes even after selecting the file, No file chosen appears. Once the Element response-wrapper appears
assume that the file being chosen.

7. Click Next
8. Review and Click Done

Page 12 of 25
Define the Target Application
1. Configure this exactly as you have done for the Source. You will be using the same REST connection that is created.
Drag and drop SalesCloudREST <CLASSID> <STUDENTID> connection on to the Invoke.

Page 13 of 25
2. Click Next. Provide the following resource parameters, then click Next:

Parameter Type

onlyData boolean

fields string

orderBy string

Limit integer

q string

Click on Next. This will show a page like below…

Page 14 of 25
Select option JSON Sample then select SampleSalesCloudResponse.txt file.

Click on Next. The summary page will appear like below.

Click Done.

Page 15 of 25
The integration flow should look like below…

Specify the Request Mapping


Click on the Request Mapping to map the elements from Source to Target REST endpoints.

Map the elements as shown here.

Source Field Target Field

execute > Query Parameters > onlyData execute > Query Parameters > onlyData

execute > Query Parameters > fields execute > Query Parameters > fields

execute > Query Parameters > orderBy execute > Query Parameters > orderBy

execute > Query Parameters > Limit execute > Query Parameters > Limit

execute > Query Parameters > q execute > Query Parameters > q

Page 16 of 25
After mapping is done, the mapper looks like below.

Specify the Response Mapping


Invoke the response mapper by selecting icon.

Mapper appears as below.

Page 17 of 25
Map source to target elements as shown here.

Source Field Target Field

execute Response > response-wrapper> items execute Response > response-wrapper> items

execute Response > response-wrapper> items> execute Response > response-wrapper> items>
OrganizationName OrganizationName

execute Response > response-wrapper> count execute Response > response-wrapper> count

execute Response > response-wrapper> hasMore execute Response > response-wrapper> hasMore

execute Response > response-wrapper> limit execute Response > response-wrapper> limit

execute Response > response-wrapper> offset execute Response > response-wrapper> offset

Map as shown in the below image…

Page 18 of 25
Add Tracking

1. Click on Tracking.
2. Configure Business Identifiers for Tracking, drag and drop the fields on to Tracking Field.

3. Click Done
4. Click Save. Observe that the integration flow is 100 % complete.

Page 19 of 25
Activation

1. Activate the integration, by clicking toggle button. You will be prompted with a dialog box to “enable tracing
including payload into Activity Stream”, check the box. Click on Yes.

2. Click on the icon to copy the Integration Flow endpoint URL. You will use soap-ui for testing.

Page 20 of 25
Note: Your endpoint URL will not be the same as the above.

Test Using SOAP UI


We will test our integration using SOAP UI.

You need the endpoint URL, shown above for testing.

1. Create a New REST Project

2. Paste in the Endpoint URL. Then click OK.

Page 21 of 25
Review the Request1.

3. Add your ICS credentials via the Auth tab.

Page 22 of 25
4. Execute the Request

5. Check the HTML output

Page 23 of 25
Note: the resource is /accounts. You will test this now.

6. Change the resource from metadata to accounts.

7. Now add the required parameters

Page 24 of 25
8. Execute the Request

Summary
In this lab, you learned how to leverage the ICS REST adapter.

Page 25 of 25

You might also like