8 Working with Data Services

This chapter describes how to configure and generate data services with Oracle Data Integrator. Data services enable access to your data via a web service interface. It also allows access to the changes captured using Oracle Data Integrator's Changed Data Capture feature.

This chapter includes the following sections:

8.1 Introduction to Data Services

Data Services are specialized Web Services that provide access to data in datastores, and to changes captured for these datastores using Changed Data Capture. These Web Services are automatically generated by Oracle Data Integrator and deployed to a Web Services container in an application server.

Data Services can be generated and deployed into:

  • A web service stack implementing the Java API for XML Web Services (JAX-WS), such as Oracle WebLogic Server.

  • Apache Axis2 , installed in an application server.

WARNING:

Axis2 is deprecated in this version. Customers using Axis2 should migrate their data services implementation by regenerating and re-deploying them in a JAX-WS container.

8.2 Setting Up Data Services

Data services are deployed in a web service container (an application server into which the web service stack is installed). This web service container must be declared in the topology in the form of a data server, attached to the Axis2 or JAX-WS technology.

As data services are deployed in an application server, data sources must also be defined in the topology for accessing the data from this application server, and deployed or created in the application server.

Setting up data services involves steps covered in the following sections:

8.2.1 Configuring the Web Services Container

You must declare the web service container as a data server in the topology, in order to let Oracle Data Integrator deploy Data Services into it.

Note:

Be careful not to mistake the web service containers and the servers containing the data. While both are declared as data servers in Oracle Data Integrator, the former do not contain any data. They are only used to publish Data Services.

Web service containers declared in Oracle Data Integrator have one of three modes of deploying Web Services:

  • Copying files directly onto the server, if you have file access to the server.

  • Uploading onto the server by FTP.

  • Uploading with the Web Service Upload method with Axis2.

The next steps in the configuration of the Web Services container depend on type of web service container and the deployment mode you choose to use.

To configure a web service container:

  1. In Topology Navigator expand the Technologies node in the Physical Architecture panel.

  2. Select the technology corresponding to the web server container: Axis2 or JAX-WS. If you are using Oracle WebLogic Server or another JEE 5 compatible application server, use JAX-WS.

  3. Right-click and select New Data Server

  4. Fill in the following fields in the Definition tab:

    • Name: Name of the Data Server that will appear in Oracle Data Integrator.

      For naming data servers, it is recommended to use the following naming standard: <TECHNOLOGY_NAME>_<SERVER_NAME>.

    • Base URL for published services: Enter the base URL from which the web services will be available. For Axis2, it is http://<host>:<HTTP Port>/axis2/services/, and for Oracle WebLogic Server it is http://<host>:<HTTP Port>/

  5. Select one of the following Deployment options:

    • Save web services into directory: directory into which the web service will be created. It can be a network directory on the application server or a local directory if you plan to deploy the web services separately into the container.

    • Upload web services by FTP: select this option to upload the generated web service to the container. You must provide a FTP URL as well as a User name and Password for performing the upload operation.

    • Upload web services with Axis2: select this option to upload the generated web service to the container using Axis2 web service upload mechanism. This option appears only for Axis2 containers. You must provide the Base URL for Axis2 web application - typically http://<host>:<HTTP Port>/axis2/axis2admin/ - as well as an Axis2 User name and Password for performing the upload operation.

  6. From the File menu, click Save. The data server appears in the physical architecture.

  7. Select this data server, right-click and select New Physical Schema. A new physical schema Editor appears. In the Context tab, and create a logical schema for this new physical schema, or associate it to an existing logical schema. The process for creating logical schemas is detailed in Chapter 4, "Setting-up the Topology".

  8. From the File menu, click Save.

You only need to configure one physical schema for the web container. Note that the logical schema/context/physical schema association is important here as the context will condition the container into which deployment will take place.

8.2.2 Setting up the Data Sources

The Data Services generated by Oracle Data Integrator do not contain connection information for sources and targets. Instead, they make use of data sources defined within the Web Services container or on the application server. These data sources contain connection properties required to access data, and must correspond to data servers already defined within the Oracle Data Integrator topology.

To set up a data source, you can either:

  • Configure the data sources from the application server console. For more information, refer to your application server documentation.

  • Deploy the data source from Oracle Data Integrator if the container is an Oracle WebLogic Server. See Chapter 4, "Setting-up the Topology" for more information on data source deployment.

8.2.3 Configuring the Model

To configure Data Services, you must first create and populate a model. See Chapter 5, "Creating and Reverse-Engineering a Model" for more information.

You should also have imported the appropriate Service Knowledge Module (SKM) into one of your projects. The SKM contains the code template from which the Data Services will be generated. For more information on importing KMs, see Chapter 9, "Creating an Integration Project".

To configure a model for data services:

  1. In the Models tree in the Designer Navigator, select the model.

  2. Double-click this model to edit it.

  3. Fill in the following fields in the Services tab:

    • Application server: select the logical schema corresponding to the container you have previously defined.

    • Namespace: type in the namespace that will be used in the web services WSDL.

    • Package name: Name of the generated Java package that contains your Web Service. Generally, this is of the form com.<company name>.<project name>.

    • Name of the data source, as defined in your container. Depending on the Application server you are using, the data source might be local or global:

      • If your data source is global, you only need to enter the data source name in the Datasource name field.

      • If your data source is local, the data source name should be prefixed by java:/comp/env/.

      Note that OC4J uses per default a global data source, Tomcat a local data source. Refer to the documentation of your application server for more information.

    • Name of data service: This name is used for the data services operating at the model level. You can also define a data service name for each datastore later.

  4. Select a Service Knowledge Module (SKM) from the list, and set its options. See the Oracle Fusion Middleware Connectivity and Knowledge Modules Guide for Oracle Data Integrator for more information about this KM and its options. Only SKMs imported into projects appear in this list.

  5. Go to the Deployed Datastores tab.

  6. Select every datastore that you wish to expose with a data service. For each of those, specify a Data Service Name and the name of the Published Entity.

  7. From the File menu, click Save.

Although not required, you can also fine-tune the configuration of the generated data services at the datastore and column level.

For example, you can specify the operations that will be permitted for each column. One important use of this is to lock a column against being written to via data services.

To configure data services options at the datastore level:

  1. In the Models tree in the Designer Navigator, select the datastore.

  2. Double-click this datastore to edit it.

  3. Select the Services tab.

  4. Check Deploy as Data Service if you want the datastore to be deployed.

  5. Enter the Data Service Name and the name of the Published Entity for the datastore.

  6. From the File menu, click Save.

To configure data service options at the column level:

  1. In the Models tree in the Designer Navigator, select the column.

  2. Double-click this column to edit it.

  3. Select the Services tab.

  4. Check the operation that you want to allow: SELECT, INSERT, DELETE. The INSERT action includes the UPDATE action.

  5. From the File menu, click Save.

8.3 Generating and Deploying Data Services

Once the model, data sources and container have been configured, it is possible to generate and deploy the data services.

8.3.1 Generating and Deploying Data Services

Generating data services for a model generates model-level data services as well as the data services for the selected datastores in this model.

To generate Data Services for a model:

  1. In the Models tree in the Designer Navigator, select the model.

  2. Right-click, and select Generate Service. The Generating Data Service window opens.

  3. In the Generating Data Service window, fill in the following fields:

    • Store generated Data Services in: Oracle Data Integrator places the generated source code and the compiled Web Service here. This directory is a temporary location that can be deleted after generation. You can review the generated source code for the data services here.

    • Context: Context into which the data services are generated and deployed. This context choice has three effects:

      • Determining the JDBC/Java datatype bindings at generation time.

      • Determining which physical schemas are used to serve the data.

      • Determining which physical Web Services container is deployed to

    • Generation Phases: Choose one or more generation phases. For normal deployment, all three phases should be selected. However, it may be useful to only perform the generation phase when testing new SKMs, for instance. See below for the meaning of these phases.

  4. Click OK to start data service generation and deployment.

Phase Description
Generate code This phase performs the following operation.
  • Deletes the content of the generation directory.

  • Generates the Java source code for the data services using the code template from the SKM.

Compilation This phase performs the following operations:
  • Extracts web service framework.

  • Compiles the Java source code.

Deployment This phase performs the following operations:
  • Packages the compiled code.

  • Deploys the package to the deployment target, using the deployment method selected for the container.

Generate 10.x style WSDL This is not an generation phase. This is an option available when generating Axis2 web services. Select this option to generate web services compatible with a 10g ODI WSDL.

8.3.2 Overview of Generated Services

The data services generated by Oracle Data Integrator include model-level services and datastore level services. These services are described below.

Model-level services

Data services are generated at model-level when the model is enabled for consistent set CDC.

The following services are available at model-level:

  • extend Window (no parameters): Carries out an extend window operation.

  • lock (Subscriber Name): Locks the consistent set for the named subscriber. To lock the consistent set for several subscribers, call the service several times, using several OdiInvokeWebService steps for example.

  • unlock (Subscriber Name): Unlocks the consistent set for the named subscriber.

  • purge (no parameters): Purges consumed changes.

See Chapter 7, "Working with Changed Data Capture" for more information on these operations.

Datastore-level services

The range of operations offered by each generated data service depends on the SKM used to generate it. There are several common properties shared by the SKMs available with Oracle Data Integrator. In almost every case the name of the published entity forms part of the name of each operation. In the following examples, the published entity "Customer" is used.

The following operations are available at datastore-level:

  • Operations on a single entity. These operations allow a single record to be manipulated, by specifying a value for its primary key. Other fields may have to be supplied to describe the new row, if any. Examples: addcustomer, getcustomer, deletecustomer, updatecustomer.

  • Operations on a group of entities specified by filter. These operations involve specifying values for one or several fields to define a filter, then optionally supplying other values for the changes to made to those rows. In general, a maximum number of rows to return can also be specified. Examples: getcustomerfilter, deletecustomerfilter, updatecustomerfilter.

  • Operations on a list of entities. This list is constructed by supplying a several individual entities, as described in the "single entity" case above. Examples: addcustomerlist, deletecustomerlist, getcustomerlist, updatecustomerlist.

8.3.3 Testing Data Services

The easiest way to test generated data services is to use the graphical interface for the OdiInvokeWebService Oracle Data Integrator tool. See Chapter 15, "Working with Web Services in Oracle Data Integrator" for more information on this subject.