Introduction to Run-Time Web Services

Running Integration Processes 20-25 LoadPlanStatusResponse ns2:OdiGetLoadPlanStatusResponse S:Body S:Envelope

20.11.9 Listing Contexts Using a Web Service

The listContext operation of the public web service lists of all the contexts present in a master repository. listContextRequest OdiUserodi_userOdiUser OdiPasswordodi_passwordOdiPassword listContextRequest

20.11.10 Listing Scenarios Using a Web Service

The listScenario operation of the public web service lists of all the scenarios present in a given work repository. listScenarioRequest OdiUserodi_userOdiUser OdiPasswordodi_passwordOdiPassword WorkRepositorywork_repositoryWorkRepository listScenarioRequest

20.11.11 Accessing the Web Service from a Command Line

Oracle Data Integrator contains two shell scripts for UNIX platforms that use the web service interface for starting and monitoring scenarios from a command line via the run-time agent web service operations: ■ startscenremote.sh starts a scenario on a remote agent on its web service. This scenario can be started synchronously or asynchronously. When started asynchronously, it is possible to have the script polling regularly for the session status until the session completes or a timeout is reached. ■ getsessionstatusremote.sh gets the status of a session via the web service interface. This second script is used in the startscenremote.sh script. Before accessing a web service from a command line, read carefully the following important notes: ■ The command line scripts, which are required for performing the tasks described in this section, are only available if you have installed the Oracle Data Integrator Standalone Agent. See the Oracle Fusion Middleware Installation Guide for Oracle Data Integrator for information about how to install the Standalone Agent. ■ Unlike the startscen.sh command line, these scripts rely on the lightweight WGET utility installed with the UNIX or Linux platform to perform the web service calls. It does not use any java code and uses a polling mechanism to reduce the number of running processes on the machine. These scripts are suitable when a large number of scenarios and sessions need to be managed simultaneously from a command line. Starting a Scenario To start a scenario from a command line via the web service: 1. Change directory to the agentbin directory of the Oracle Data Integrator installation. 20-26 Oracle Fusion Middleware Developers Guide for Oracle Data Integrator 2. Enter the following command to start a scenario. On UNIX systems: .startscenremote.sh scenario_name scenario_version context_code work_repository remote_agent_url odi_ user odi_password -l log_level -s sync_mode -n session_name -k session_keyword -a assign_variable -t timeout -i interval -h http_timeout -v Table 20–9 lists the different parameters of this command, both mandatory and optional. Table 20–9 Startscenremote command Parameters Parameters Description scenario_name Name of the scenario mandatory. scenario_version Version of the scenario mandatory. If the version specified is -1, the latest version of the scenario is executed. context_code Code of the execution context mandatory. -l log_level Level of logging information to retain. This parameter is in the format LEVELn where n is the expected logging level, between 0 and 5. The default log level is 5. Example: startscen.bat SCENAR 1 GLOBAL LEVEL5 work_repository Name of the work repository containing the scenario. remote_agent_url URL of the run-time agent that will run this session. odi_user Name of the user used to run this sessions. odi_password This user’s password. s sync_mode Execution mode: ■ 0: Synchronous ■ 1:Asynchronous Do not wait for session completion ■ 2: Asynchronous Wait for session completion. -n session_name Name of the session -k session_keyword List of keywords attached to this session. These keywords make session identification easier. The list is a comma-separated list of keywords. -a assign_variable Assign variable. Allows to assign a value to a variable for the execution of the scenario. variable is either a project or global variable. Project variables should be named Project Code.Variable Name. Global variables should be called GLOBAL.variable Name. This parameter can be repeated to assign several variables. Do not use a hash sign to prefix the variable name on the startscen command line. For Example: -a PROJ1.VAR1=100 -t timeout Timeout in seconds for waiting for session to complete if sync_ mode = 2. -i interval Polling interval for session status if sync_mode = 2. -h http_timeout HTTP timeout for the web services calls.