Odi 12.2.1: Rest
Odi 12.2.1: Rest
Odi 12.2.1: Rest
Purpose
In this tutorial you learn about the RESTful service support available in Oracle Data Integrator (ODI)
12.2.1.2.6.
Time to Complete
Approximately 40 minutes
Background
ODI 12.2.1.2.6 supports RESTful services invocation for reading or writing data. The RESTful endpoints can
be configured like any other data server in topology and can be easily invoked through an ODI tool in the
integration flow.
Scenario
In this example, you will query Google's financial services website from ODI to return the stock prices of
various companies to json files.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 1 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
A minimum of 6 GB RAM
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 2 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
3. In the Oracle Data Integrator Login dialog box, enter the following values and then click OK..
The user and password is prepopulated from the wallet. If you're asked for the wallet password, enter
welcome1.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 3 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
1. In the Topology tab, expand Physical Architecture and Technologies, then right-click Restful Services
and select New Data Server.
Name: GoogleFinanceRestService
REST Service Endpoint URL: http://finance.google.com
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 4 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
3. In the ODI toolbar, click Save, then click OK in the Information dialog. Click Test Connection, then OK in
the Information dialog.
If the test is successful, you can close the GoogleFinanceRestService tab. If it was unsuccessful, you
need to modify ODI's connection to the Internet. Click Tools/Preferences menu item, then in the
Preference dialog box, click Web Browser and Proxy, select Proxy Settings tab and alter your settings.
4. In the Topology tab, under Physical Architecture and Technologies, expand RESTful Service, right-
click GoogleFinanceRestService and select New Physical Schema from the menu.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 5 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
5. In the GoogleFinanceRest Service Resource URI form, enter /finance in the Resource URI field. Note
that the URI gets appended to the Name.
6. Switch to the Operations tab. Click Add Operation and set the following parameter values:
Name: getQuote
Method: GET
Operation URI: info
Query Parameter: Click ..., then click Add Parameter in the Edit Query Parameters dialog window, and
add the following parameters:
Name Value
client q
q NASDAQ:ORCL
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 6 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
7. In the ODI toolbar, click Save. Click OK to dismiss the Information dialog box.
8. Switch to the Context tab. Click Add to add a Context. Enter the following:
Context: Global
Logical Schema: google-finance-get-quote
9. In the ODI toolbar, click Save, then close GoogleFinanceRest Service Resource URI.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 7 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
1. In the Designer tab, expand Projects, right-click Beta and select New Folder.
2. In the New Object form, enter Rest Tool Invocation in the Name field, then click Save in the ODI
toolbar. Close the Rest Tool Invocation tab.
3. In the Designer tab, under Projects, expand Beta and Rest Tool Invocation, then right-click Packages
and select New Package.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 8 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
4. In the New dialog box, enter PkgGetQuote in the Name field, a suitable description in the Description
field, then click OK.
5. From Toolbox pane, select OdiInvokeRESTfulService, then click a space in the Package map area to
add it as a step to the package. Make sure it is defined as the first step in the package. Right click it and
in the resulting menu, see that First Step is selected. If not, select it.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 9 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
Context: Global
Logical Schema: google-finance-get-quote
Main Operation: getQuote
Response File: <vm_file_path>/getQuoteORCL.json
Append to Response File: No
Trace File: <vm_file_path>/getQuoteTraceORCL.txt
Append to Trace File: No
For <vm_file_path>, enter a location on your machine where the response files will be saved.
You can always test the service by clicking Test Restful Service button.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 10 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
7. From Toolbox, add another OdiInvokeRESTfulService step into the Package map area, then enter the
following parameter values:
Context: Global
Logical Schema: google-finance-get-quote
Main Operation: getQuote
Response File: <vm_file_path>/getQuoteAAPL.xml
Append to Response File: No
Trace File: <vm_file_path>/getQuoteTraceAAPL.txt
Append to Trace File: No
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 11 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
For <vm_file_path>, enter a location on your machine where the response files will be saved.
8. Click Next step on success. Click on the first OdiInvokeRESTfulService and drag the cursor to the
second one. This create a link between the two.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 12 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
9. In the ODI toolbar, click Save, then click Run. Click OK in the Run dialog window, and again in the
Information dialog window. Confirm the response and status files have been correctly created.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 13 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
The following sections illustrate how to use parameters with the REST tool.
1. In the Topology tab, expand Technologies, RESTful Service and GoogleFinanceRestService, then
double-click GoogleFinanceRestService./finance.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 14 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
2. In the GoogleFinanceRestService./finance page, switch to the Operations tab, then click Add
Operation and add the following:
Name: getQuoteUsingTemplateParams
Method: GET
Query Parameter: Click ..., then click Add Parameter in the Edit Query Parameters dialog window, and
add the following parameters:
Name Value
client q
q #[symbol#}
Template Parameter: Click ... and enter ORCL in the Value field for symbol.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 15 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
1. Switch to the Designer tab and expand Projects, Beta, right-click Variables and select New Variable.
2. In the New Object form, enter var_symbol in the Name field and select Text for Datatype.
4. In the Designer tab, under Projects and Beta, expand Rest Tool Invocation, right-click Packages and
then select New Packages.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 16 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
5. In the New dialog window, enter PkgGetQuoteUsingVariables in the Name field, enter a suitable
description in the Description field, and then click OK.
6. In the Toolbox pane, select OdiInvokeRESTfulService, then click in the Package mapping area to add it
as the first step.
7. Set the following parameter values in the Properties pane below for OdiInvokeRESTfulService1:
Context: Global
Logical Schema: google-finance-get-quote
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 17 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
For <vm_file_path>, enter a location on your machine where the response files will be saved.
8. From the Designer tab, under Projects, Beta, Variables, drag and drop var_symbol into the
PkgGetQuoteUsingVariables package map, then set the following parameter values:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 18 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
Value: GOOG
9. In the Package toolbar, click Next step on Success, then click odiInvokeRESTfulService1 and drag
your cursor to var_symbol, creating a link between the two steps.
10. From the Toolbox pane, select OdiInvokeRESTfulService, then click in the package map area to add it
as the third step. Set the following parameter values:
Context: Global
Logical Schema: google-finance-get-quote
Main Operation: getQuoteUsingTemplateparams
Response File: <vm_file_path>/getQuote_GOOG.json
Append to Response File: No
Trace File: <vm_file_path>/getQuoteTraceGOOG.txt
Append to Trace File: No
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 19 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
For <vm_file_path>, enter a location on your machine where the response files will be saved.
11. In the Package toolbar, click Next Step on Success, then click var_symbol step and drag the cursor to
the OdiInvokeRESTfulSerive2 step, creating a link between the two steps.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 20 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
12. In the ODI toolbar, click Save, then click Run. Click OK in the Run dialog window, and again in the
Information dialog window. Verify that the session ran successfully and that the response and status files
were created properly. Note that the template parameter was substituted with variable value during
execution.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 21 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
Credits
Resources
You can read more about Oracle Data Integrator 12.2.1.2.6 with our documentation
(http://docs.oracle.com/middleware/122126/odi/index.html).
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 22 of 23
ODI 12.2.1: REST 11/27/17, 8(40 AM
More OBEs for ODI are available from the Oracle Learning Library (https://apexapps.oracle.com/pls/apex/f?
About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html)
Legal Notices (http://www.oracle.com/us/legal/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright 2015, Oracle and/or its aliates. All rights reserved.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/odi_12.2.1.1/Integrating_RESTful_Services/ODI_12_2_1_REST.html Page 23 of 23