Você está na página 1de 39

Oracle Data Integrator 11g Bootcamp

Lesson 19 : Web Services

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Agenda
Learn about different web services
Configure and deploy data services
Learn about Run-Time web services
Invoke a third party web service
Summary

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Web Services in ODI


ODI provides the following entry points into a service-oriented architecture (SOA)
Data services
- enables access to ODI objects through web services
ODI Run-Time services
- enables access to ODI features through web services
Invoking Third-Party web services
- enables access to data exposed by third party web services

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

What are Data Services?


Data Services are SOAP web services which expose:
Data stored in data stores (source and target both)
Data currently stored in journalization framework
Data services can be used to manipulate data
Automatically generated by ODI using SKM (Service Knowledge Module)
Deployed in a Java EE application server
WebLogic Server (JAX-WS)
Axis2 server

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Data Services Types


Data services generates two types of web services
Model level
- A single web service for the model
- The model should be enabled for consistent set journalization
Data-store level
- A web service for each datastore
WSDL
http://<host_name>:<port>/<model_name>/<webservice_name>?wsdl

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Data Services - Model Level Web Services


ExtendWindow (no parameters)
Performs extend window operation and collects a consistent set of recent
changes for all subscribers
Lock (SubscriberName)
Locks the consistent set for the name subscriber
UnLock (SubscriberName)
Unlocks the consistent set for the named subscriber
Validates consumption of captured changes
Ends processing and discards changes
Purge (no parameters)
Purges consumed data

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Data Services - Data-store Level Web Services (1)


Single entity
A single record can be modified by using its primary key
- addOrder
- getOrder
- deleteOrder
- updateOrder
Group of entities specified by a filter
Filter can be created by using several fields and then values can be passed for
manipulation
No. of rows to return can also be specified
- deleteSrcOrder
- getSrcOrder
- updateSrcOrder
T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Data Services - Data-store Level Web Services (2)

List of entities
A list is constructed by combining several single entity for manipulation
- addOrderlist
- deleteOrderlist
- updateOrderlist
- getOrderlist

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Configuring Data Service Step 1 : JAX-WS Data Server


Under Topology>Physical Architecture, right click on JAX-WS technology and
select New Data Server
Name the data server and specify directory for holding the ODI generated war file
Specify base url which would be used by published data services
http://<host>:<port>/

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Configuring Data Service Step 2 : JAX-WS Physical Schema


Under Topology>Physical Architecture, right click on a data server under JAX-WS
technology and select New Physical Schema
Accept the default values for the physical schema

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Configuring Data Service Step 2 : JAX-WS Logical Schema


Under Topology>Logical Architecture, right click on JAX-WS technology and
select New Logical Schema
Name the logical schema and set the Context to point to Physical schemas

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Configuring Data Service Step 3 : Select a Model


Under Designer>Models, open a model and click the Services tab

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Configuring Data Service Step 4 : Configure Services


Name of Data Source

Name
Data source
connection
of Data
Service name defined on your Weblogic\Axis2
server
JSNDI\JDBC
the database
et a name connection
for the data for
service

Application server
Knowledge Module
Namespace
Set a Logical Schema - JAX-WS or AXIS2

Sfrom
electthe
a technology
Package
name
drop down specific
menu SKM form the drop down menu

STetheaSKMs
value for
namespace
thatinto
will the
be used
in the generated
must
be imported
project
WSDL
Set a package name, this will be used to name the generated
Java package that contains the webservice
Follow your organization Java package naming standards

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Configuring Data Service Step 5 : Identify the Data Stores


On the Services tab, click the Deployed Datastores tab
Select the datastores by enabling the Active check box
Specify the Web Service name and Published entity which is used for generating
web service operation names

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Configuring Data Service Step 6 : Column Selection & Operation


Using models, edit each column
Under Definition tab, use the check box under Data Service Operations to allow
insert,update and delete operations via web service

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Configuring Data Service Step 7 : Generate


Right click a model and select Generate Service
On the Generating Data Service, set the Context and specify directory to Store
generated Data Service
Use the check boxes under Generation phases to generate both the java code
and war deployment file

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Configuring Data Service Step 8 : Verify


Expand the model and datastores to view all the available operations under
webService
Verify the java code and war file is generated

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Deploying Data Services Step 1 : Deploy Application


Options to deploy the war file (application) generated by ODI into weblogic
Manually
- Oracle Weblogic Administration Control
Scripting
- WLST scripting
C:\OracleWebLogic\Middleware\Oracle_ODI\common\bin> wlst
...
connect('weblogic','Admin123','t3://localhost:7001')
...
deploy('TRAINING_STG','C:/ODI11g_Course/DataServices/
TRAINING_STG.war',targets='ODIServer')
...
exit()

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Deploying Data Services Step 2 : Verify


Login to Oracle Weblogic Enterprise Manager and verify the application is
deployed

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Data Sources for Web Services


Data sources are a database connection that needs to be created on the
application server
Web services use data sources for accessing data
Weblogic uses JDBC\JNDI connection for data sources

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Data Sources for Web Services - Deployment Options


Options for deploying data sources on weblogic
Manually
- Oracle Weblogic Administration Console
- Data sources can be deployed both on admin and managed servers
Scripting
- WSLT scripting
- Data sources can be deployed both on admin and managed servers
ODI
- Java EE Agent on weblogic
- Deploys data source only on admin Server

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Deploying Data Sources Step 1 : Select Data Server


Drag and drop data server from Topology>Physical Architecture into the Data
Sources tab of a phyiscal agent
Rename the JNDI Name as per the organization standard

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Deploying Data Sources Step 2 : Deploy


Right click on a data source, select Deploy Data Source on WLS
On the WLS DataSources deployment dialog, set Host, Port, User, Password and
Target
Click OK button to deploy

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Deploying Data Sources Step 3 : Verify


Login to Oracle Weblogic Administration Console and verify the data source is
deployed

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

What are Run-Time Services?


Run-Time services consists of
Public Web Service
- Connects to repository to retrieve a list of context and scenarios
- Deployed in a Java EE application server
Agent Web Service
- Commands ODI agent to start and monitor a scenario and to restart a
session
- It is built-in the Java EE and Standalone agent
Both are SOAP web services

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Public Web Service - WSDL and Operations


WSDL - http://<host_name>:<port>/oracledisdkws/oracledisdkws?wsdl
Web service operations
listContext
- Provides a list all the contexts
- Parameters are ODI username and password
listScenario
- Provides a list all the scenarios in a work repository
- Parameters are ODI username, password and work repository name

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Agent Web Service - WSDL


WSDL
Standalone Agent
- http://<host_name>:<port>/oraclediagent/odiInvoke?wsdl
Java EE Agent
- http://<host_name>:<port>/<agent_application_context>/odiInvoke?wsdl

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Agent Web Service - Operations


getVersion (no parameters)
Returns ODI version and date
getSessionStatus
Returns session status for a list of session id s
Parameters are ODI user, password, work repository name and session id s
invokeStartScen
To execute a scenario
Parameters are ODI user, password, work repository name and scenarios
specific parameters (context,name,version,etc)
invokeRestartSess
To restart a session
Parameters are ODI user, password, work repository name and session
specific parameters (id, synchronous, session variables)
T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Testing Data Services and Run-Time Services


Services can be tested using
Oracle Weblogic Administration Control - test web service client
Oracle Weblogic Enterprise Manager - test web service option
ODI - OdiInvokeWebService tool
Others - SOAPUI , cURL,etc

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Invoking Third Party Web Services


OdiInvokeWebServices tool can invoke any third party web services
Supports SOAP web services
Saves the response in an XML file that can be processed by ODI
Tool can be added as a step in package or procedure
Tool can be executed from command line

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Invoking Web Services Step 1 : Add OdiInvokeWebServices


Create an ODI Package
Under Toolbox>Internet, add OdiInvokeWebServices tool to the ODI Package
On the Properties panel, click the Advanced tab
to launch the advanced editor

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Invoking Web Services Step 2 : Parse WSDL


On the OdiInvokeWebService Advanced Editor dialog, set the WSDL URL and
click the connect button

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Invoking Web Services Step 3 : Select Port and Operation


On the OdiInvokeWebService Advanced Editor dialog, select the web service Port
from the drop down menu
Select the operation listed under the web service port to view the request XML

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Invoking Web Services Step 4 : Generate a Test Response


Set test data in the request XML and click the execute web service button
On success response XML will be generated
Click the OK button

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Invoking Web Services Step 5 : Set the Response File


On the Properties panel of the OdiInvokeWebService tool, set the Storage Mode
for Response File to NEW_FILE to generate a new file
Set the Response File value to store the response XML

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Invoking Web Services Step 6 : Execute and Verify


Execute the ODI package or the OdiInvokeWebService step
XML file should be created

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Hands-On Labs
Lab 19 - Web Services

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Summary
Data Services can be used to consume and modify data in the data stores
Run-Time Services provides way to invoke integration processes from a SOA
environment
Third party web services can easily be invoked\consumed using ODI

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Oracle Data Integrator 11g Bootcamp


Lesson 19 : Web Services

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Você também pode gostar