Skip Headers

Oracle9i Application Developer's Guide - XML
Release 1 (9.0.1)

Part Number A88894-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

18
Using Oracle9iAS Dynamic Services and XML

Oracle9iAS Dynamic Services (Dynamic Services or DS) enables developers to take advantage of Web application functionality and content, as services to increase productivity. DS adds web services deployment and management capability to Oracle9i. Developers can use Oracle9i Dynamic Services to compose, catalog, manage, and personalize web services according to user roles, protocols and delivery devices.

This chapter describes the following sections:

Introducing Oracle9iAS Dynamic Services

Oracle9iAS Dynamic Services (DS) is a Java-based programmatic framework for incorporating, managing, and deploying Internet and Intranet services. It uses the Internet as the information source. It facilitates the rapid incorporation of services from Web sites, local databases, and proprietary systems into applications.

For example, an online financial portfolio application can use DS to integrate Internet financial services, such as stock quotes and exchange rates, from different resource providers to calculate the current value of a portfolio in foreign currency. See also Figure 18-1 and "Dynamic Services Consumer Application: Stock Portfolio Example" .

DS handles dynamic business models with no degradation in service quality.

A DS "service" provides access to information or application functionality through standard Internet protocols, such as, HTTP, JDBC, or SOAP. A "service" can also aggregate other DS services to form a compound service with a specific execution flow. It can include transformations and conditional logic and is accessible through a uniform interface.

Figure 18-1 illustrates a typical Dynamic Services (DS) scenario. This is a workflow of how an application can use DS services to retrieve and manage the data. You simply need to determine the semantics and output formats needed:

  1. The database notes that the inventory is getting low for a certain part in your inventory. This triggers an event that tells you a specific part is low.

  2. A DS service is then invoked that access a supplier and invokes the service that accesses the information. The supplier ABC's site could be in a foreign currency or different format. Data about the supplier is logged as well as a catalog of parts available.

  3. Another service is invoked that translates the language and currency to the desired language and currency of your Inventory Application.

  4. The inventory application can also be connected to other applications. In steps 4 and 5 the results are delivered in multiple channels.

  5. The resulting data is formatted according to the devices target user's devices. The DS service can also render the results in any format that the service has been equipped for using stylesheets. The data is transferred mostly in XML.

Figure 18-1 Typical Dynamic Services Scenario


Text description of dyn5.jpg follows.
Text description of the illustration dyn5.jpg

How Dynamic Services (DS) Helps Developers

DS meets the design criteria needed by application developers in that with DS, developers have:

For Further Information

For further information about Oracle9iAS Dynamic Services:

See:

 

What is Needed to Run Oracle9iAS Dynamic Services?

To run Oracle9iAS Dynamic Services you need the following:

Ensure that you have at least a full (typical) installation of Oracle9i.

Dynamic Services (DS) Architecture Overview

Figure 18-2 shows an overview of Oracle Dynamic Services (DS) architecture. It shows the following:

Figure 18-2 Oracle Dynamic Services (DS) Architecture


Text description of dsarch.gif follows.
Text description of the illustration dsarch.gif

Dynamic Services can be deployed in the following ways:

Dynamic Services (DS) Implementation Overview

Oracle9iAS Dynamic Services (DS) currently offers deployment modes:

Main DS Components

The following lists the DS main components for each of these deployment modes.

Dynamic Services Java Deployment

Figure 18-3 shows the Dynamic Services Java deployment view. Oracle9i serves as a registry cache, communicating with the OID Lightweight Directory Access Protocol (LDAP) server hosting the registries. Service Consumer Application contains application logic that uses the services through direct Java calls.

Here, Service Consumer Application uses the DS thick client library, that contains the Dynamic Services Execution Engine. Service providers run in their own servers.

Figure 18-3 Oracle Dynamic Services: Java Deployment


Text description of dysrv_i3.gif follows.
Text description of the illustration dysrv_i3.gif

Dynamic Services PL/SQL Deployment

Figure 18-4 shows Oracle Dynamic Services PL/SQL deployment. The Dynamic Services engine runs in the Oracle9i JVM, with its functions exposed as a set of Java stored procedures. Oracle9i database serves as a registry cache. It communicates with Oracle Internet Directory LDAP server which hosts the registries. The Service Consumer Application's logic makes use of the services through PL/SQL calls. Service Providers run in their own servers.

Figure 18-4 Oracle Dynamic Services: PL/SQL Deployment


Text description of dysrv_ic.gif follows.
Text description of the illustration dysrv_ic.gif

Dynamic Services Java HTTP/Java Messaging Services (JMS) Deployment

Figure 18-5 shows an Oracle Dynamic Services Java (HTTP/JMS) deployment view. The Dynamic Services engine running in a Dynamic Services gateway (middle tier) supports HTTP, HTTPS, and JMS communication protocols. Oracle9i database serves as a registry cache, communicating with the Oracle Internet Directory LDAP server hosting the registries. The Service Consumer Application's logic, makes use of the services through Dynamic Services' thin Java client library, and executes services remotely in other systems.

Here, service execution requests are forwarded to the Dynamic Services gateway, which executes the service and returns a response. Communication between the service consumer application and the gateway is handled by the Dynamic Services thin client library.

Figure 18-5 Oracle Dynamic Services Java (HTTP/JMS) Deployment


Text description of dysrv_i4.gif follows.
Text description of the illustration dysrv_i4.gif

For example, in asynchronous deployment communications (JMS), the DSJMSDriver can allow for asynchronous access to services, in the form of a JMS daemon (using a Dynamic Services gateway). The driver allows request submission asynchronously to an AQ/JMS queue in a remote database. The driver assumes the existence of this JMS daemon running somewhere that listens asynchronously to the same queue where requests are being submitted.

The JMS daemon takes on the role of the Dynamic Services engine. It processes the request, generates a response, and submits the response to another queue that the DSJMSDriver listens to asynchronously.

On the service consumer application side, therefore, listeners can be registered to be informed when the response is returned.

See Also:

  • Oracle Directory Service Integration and Deployment Guide

  • Oracle Dynamic Services User's and Administrator's Guide

for more information about Dynamic Services' Java, PL/SQL, and JMS deployment. 

Multiple Channel Capabilities of DS

Figure 18-6 illustrates the multiple channels through which DS can be delivered. These include:

Figure 18-6 Dynamic Services Overview


Text description of dynam1.jpg follows.
Text description of the illustration dynam1.jpg

Dynamic Services Features

Dynamic Services (DS) features include the following:

Service Management and Administration

Dynamic Services' (DS) service management and administration features include:

DS business relationship management can handle such business tasks as:

In forthcoming releases, DS will be managed and administered through Oracle Enterprise Manager.

Service Discovery

Dynamic Services' service discovery feature supports run-time Intranet Discovery (LDAP). For example, service descriptors can be stored in Oracle Internet Directory (OID) for security, centralized management, and LDAP lookup. They can be accessed from mirrored Oracle instances for improved runtime performance.

Service Execution

Dynamic Services service execution features include the following:

The following sections and diagrams describe these DS service execution features.

Figure 18-7 DS: Executing a Service -- Overview


Text description of dynsrv_7.gif follows.
Text description of the illustration dynsrv_7.gif
D

Failover Services

DS Failover services is a prioritized list of backup equivalent services. Figure 18-8 shows an example of failover services used in a stock quote application.

Figure 18-8 Dynamic Services: Failover Services Example


Text description of dynsrv_9.gif follows.
Text description of the illustration dynsrv_9.gif

Compound Services

DS allows you to aggregate services and specify which services you need executed in parallel and which services you need executed in series.

For example, Figure 18-9 shows how you can take one or more services, here Service 1 and Service 2, and combine the results by performing operations (here merging or splitting) on them to generate a single result. You can also take the output of one service and input this into another service.

Figure 18-9 Dynamic Services: Compound Services


Text description of dynsrv10.gif follows.
Text description of the illustration dynsrv10.gif

Conditional Services

Dynamic Services can execute services according to business requirements. Requirements can be based on service request or user profile properties. Figure 18-10 shows how you can use DS to switch on a specific service(s) for 'gold' customers.

Figure 18-10 DS: Conditional Services


Text description of dynsrv11.gif follows.
Text description of the illustration dynsrv11.gif

Events or Triggers

Through the course of executing a DS service, numerous events will be generated that can be captured by the monitoring application. This application will in turn execute other DS services, termed, "monitoring services", depending on the events they receive. Figure 18-11 illustrates an example of this and how the monitored events can trigger a variety of services, including logging, notification, profiling, and billing services.

Figure 18-11 Dynamic Services: Events or Trigger Services


Text description of dynsrv12.gif follows.
Text description of the illustration dynsrv12.gif

Dynamic Services Integrates with Other Oracle Products

Dynamic Services (DS) integrates with other Oracle products, including:

How Service Consumers Use Dynamic Services

The Dynamic Services client library provides service consumers (application developers) with a Java application programming interface (API) that can be used to access the functions of the Dynamic Services engine.

See Also:

  • Oracle Directory Service Integration and Deployment Guide

  • Oracle Dynamic Services User's and Administrator's Guide

for client Java code examples used to create a service request for some of the sample services supplied with Oracle Dynamic Services, and executing them.  

For more information, refer to the sample code in <$ORACLE_HOME>/ds/demo/consumer directory and to the Javadoc API (apidoc.zip) in <$ORACLE_HOME>/ds/doc/.

Developing Services For Dynamic Services

In Dynamic Services, a service is a component within the Internet computing model that delivers a specialized value-added function. A service is bundled into a simple service package and structured as a local directory.

The following are typical tasks you will be using Dynamic Services for:

Service Response Caching

The Dynamic Services engine uses the Oracle9i database for caching service responses. The caching policy for a given service is controlled through deployment parameters in the service descriptors. Before registering a service, the Service Administrator can review these parameters and modify them as needed. The caching parameters are defined in the SERVICE_HEADER, DEPLOYMENT, and CACHING elements in the service descriptor.

To change the caching parameters of a given service, you must unregister the service and register it again with the new parameter settings. Available caching parameters are:

Oracle Syndication Server (OSS)

OSS is an application of Dynamic Services. See Chapter 19, "Oracle Syndication Server (OSS) and XML".

Dynamic Services Consumer Application: Stock Portfolio Example

The Dynamic Services software package contains sample code to specifically invoke Yahoo Portfolio service through Dynamic Service engine, using Java. Portfolio service is a service that takes stock symbols as input and give quotes as responses. This service is provided by Yahoo®.

This Dynamic Services software contains the following:

Compiling SampleStock.java

Before compiling SampleStock.java, include the following library in your CLASSPATH:

Compile SampleStock at the command line as follows:

javac SampleStock.java

To run and test the sample, proper arguments should be given in the command line, as follows:

java SampleStock <HOST_URL> <SID> <SymbolList> 

where:

Table 18-1 SampleStock Command Line Arguments
Argument  Description 

HOST_URL 

For example, egroup-dev3.us.oracle.com 

SID 

For example, db816 

SymbolList 

For example, 'ORCL INTC MSFT' 

The output of SampleStock should be a table of data about requested stocks, such as the following:

|-----+--------------------|
|     | Time  | 12:19PM    |
|     |-------+------------|
|     | Price | 30 3/16    |
|ORCL |-------+------------|
|     | Change| +0.42%     |
|     |-------+------------|
|     | Volume| 34,272,000 |
|-----+--------------------|
|     | Time  | 12:19PM    |
|     |-------+------------|
|     | Price | 35 15/64   |
|INTC |-------+------------|
|     | Change| -2.80%     |
|     |-------+------------|
|     | Volume| 22,499,200 |
|-----+--------------------|
|     | Time  | 12:19PM    |
|     |-------+------------|
|     | Price | 63         |
|MSFT |-------+------------|
|     | Change| +0.10%     |
|     |-------+------------|
|     | Volume| 24,091,600 |
|-----+--------------------|

Dynamic Services Example 1: SampleStock (Java)

SampleStock takes the command line parameters and keeps them in the class data members. Then it calls getQuotes() to retrieve the quote data.

SampleStock abstracts the process of executing YahooPortofolio DS service by:

Here is some typical XML code for SampleStock.java:

<PortfolioReq xmlns="http://www.portfolio.org/Portfolio/Request">
  <Symbol>ORCL</Symbol>
  <Symbol>INTC</Symbol>
</Portfolio>
 

Frequently Asked Questions (FAQs): Dynamic Services

What is the Best Way that I Can Set Up a Language of Queuing and Sequencing Commands?

Question:

I am investigating setting up a small language for queueing and sequencing commands. XML has obvious benefits, so I would like to know if anybody is familiar with an existing dtd for that use? This is obviously not difficult, but if a standard DTD already exists, why reinvent the wheel? Desired commands include:

Others may be required in the future.

Answer

Dynamic Services allows you to model all the commands you mentioned as XML based services.

You can define these services as well as the flow in which you can execute them. Dynamic Services engine will follow the flow (including sending email because it has SMTP services available inside the engine) and send you a completed response back. The engine is directly callable via Java/PLSQL APIs. You can also use the 'Dynamic Services Gateway' or equivalent, to accept requests over HTTP using SOAP or other SOAP like xml-rpc calls. Almost all parts of the engine are extensible to allow you to plug-in any transformation, protocol or execution flow according to your needs.

Other FAQs?

You can locate other Frequently Asked Questions (FAQs) with your DS software package at:

$ORACLE_HOME/ds/doc/dsfaq.txt


Go to previous page Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index