Professional Documents
Culture Documents
9ib DNSRV
9ib DNSRV
Corporate
applications
& databases
Most business applications, including exchanges, portals, mobile and other Web applications
collect information from many different sources. Among other requirements, the applications
must support for each information source:
•Request and response APIs and parameters
•Content formats
•Data structures, such as ResultSets, XML, Java Objects, and others
•Protocols and session management schemes for different protocols, such as cookies, URL
rewriting, or database connections
Developers must write custom code to access each of these different resources in addition to
creating application logic.
The nature of the information accessed can also create complications. It can be fairly static,
such as an employee database, or it can be dynamic information, such as financial data in the
form of a stock price or a currency conversion factor.
Finally, these application environments often lack a standard set of services, supporting any
delivery path, for business relationship management, fail-over, persistent logging, integration
with work-flows through application triggers, security, caching and personalization.
Web applications that manually integrate the necessary capabilities are usually complex to
develop and maintain and provide little in the way of reuse of services or scalability. There is
often a lot of coding and maintenance to ensure that the content is always available, works
smoothly with the existing application, and delivers what the user needs.
Service Application
DS Creation Registry Profile Registry
Assistant
Oracle Internet Directory
(OID) Server
Input adapter
The input adapter can further process the service request before sending it to the service provider.
Examples of such processing include semantic or higher-level validation of the request. The service
descriptor can optionally specify some adapter specific parameters that are validated at service
registration time, and interpreted at runtime by the adapter. The parameters for all adapters are
opaque to the service descriptor parser and service registry, and must be in XML syntax.
Output adapter
The output adapter can be used to transform the output returned by the execution adapter into an
XML document compliant with the output XML schema file specified in the service interface. The
prepackaged XSLT adapter is usually used for simple services,. For compound services, service
providers can use no adapter because the response from the execution adapter is often in the proper
format prescribed by the output XML schema file.
Protocol adapter
This adapter identifies the way that the Dynamic Services engine accesses the underlying service. For
example, a service may be accessed through the HTTP protocol, while another service may be
accessed through the JDBC protocol. The service descriptor can specify some adapter-specific
parameters which are validated at service registration time and interpreted at runtime by the adapter.
For example, for HTTP, the adapter may specify the HTTP method used and the URL that does the
actual servicing.
Execution adapter
This adaptor identifies the way in which the service has to be executed. Its responsibility is to receive
the request XML schema file and return the response from the underlying service provider. The
default execution adapter is a standard simple adapter. There can also be complex or compound
execution adapters that aggregate several services. The result of the execution adapter is the response
from the service. If the service is a simple service, the response will be in the native format of the
service. Oracle Dynamic Services New Features 1-8
Example: Using Dynamic Services Adapters to
Process a Simple Web Service Request
Extensible Stylesheet Language Transformations (XSLT) are used to transform to or from XML data.
The adapters, written in XML, offer a spectrum of functions to assist the Dynamic Services engine in
handling or processing content. The spectrum of functions ranges from converting content from a
format to another (e.g.. converting HTML to XML), delivering content in a certain protocol (e.g.
HTTP, JDBC, etc.) to determining execution method of a service (e.g. simple, fail over, etc.).
The slide illustrates how adapters work while processing a service request in Dynamic Services. A
service request comes in through Input Adapter. XSLT is applied to convert the service request into
XML. Then, the simple Execution Adapter sends the request to the Resource Provider via HTTP
through the Protocol Adapter. The resulting HTML is again converted to XML using XSLT through
the Output Adapter. Finally, the result is returned as a service response in XML.
Simple Service
A simple service provides a uniform access method. It is described in an XML Service descriptor,
providing various properties about the resource to be accessed and the syntax of the service request
and response. Service requests and responses are XML documents, decoupling information access
from rendering.
Compound Services
Compound services let you encapsulate the execution of multiple services by combining them into a
directed graph of service executions. DSCompoundServiceExecutionAdaptor coordinates the
execution of the modules according to the graph specifications, triggering the module executions
through JavaBeans events
Failover Services
DSFailOverExecutionAdaptortakes as parameters an ordered list of compatible services,
which means the services respond to the same service interface. At execution time, the failover
execution adapter tries to execute the list in order, until it finds a service that executes with no
exception. If none succeed, an exception is raised.
Conditional Services
DSConditionalExecutionAdaptorcontrols the flow of execution because it executes a
specified service based on the value of a certain defined alias. Service providers can configure the
adapter with switch statements that can be nested, to specify something like a decision tree, where the
leaf elements are the IDs of the services to execute.
Dynamic Services offers a persistent auditing feature in which events can be thrown during
execution and can be monitored. The monitoring process involves triggering of services to be
executed upon receipt of a certain event. These services that get triggered are called monitor
services.
A standalone monitor utility is provided to enable the process of auditing these events. Persistent
auditing is used to perform, among other tasks, service execution logging and failure notification
among other tasks.
Dynamic Services uses Oracle Advanced Queuing for scaleable delivery of event messages.
A set of default services is installed. These services are invoked by the event monitor utility.
The administrator can register service executions to be triggered upon certain conditions. Similar
customized conditional service execution is possible from an application as well. For example, if a
service execution fails, system services can log the failure into a database table, and at the same
time, send an email to the service owner notifying them of the failure. Such an approach easily
integrates with existing application work-flows, where, upon a service execution, a chain of services
follows.
Portal Users
This integration is based on the extensibility mechanism offered by Oracle Portal. The Oracle Portal
Web Provider interface is used to deliver content and services as portlets. Oracle Dynamic Services
includes a Web Provider that automatically makes every service in the Dynamic Services registry a
portlet, available to Oracle Portal clients. Service meta-information is published as portlet meta-
information. Oracle Portal access control and single sign-on features are mapped to Oracle Dynamic
Services.
The Portlet Provider is implemented as a Java Client of Oracle Dynamic Services that implements the
set of interfaces required by the Oracle Portal Web Provider. When asked about the set of portlets it
owns, the Web Provider forwards the call to Oracle Dynamic Services APIs. These APIs perform a
service look-up operation and return the result to the Oracle Portal. In a similar fashion, when asked
to show a portlet, the Web Provider executes the corresponding service and renders the response.
With this approach, the portlet definitions are stored by Dynamic Services in a single, centrally
managed, repository based on Oracle Internet Directory
Portlet builders also benefit from using service provider tools such as the Oracle Dynamic Services
Creation Assistant
Dynamic Services is part of Oracle’s web services offerings, so customers are more likely to look at
the solution as a whole.
Although there has been a lot of hype generated around web services, most major players do not yet
have anything in production. The closest is Microsoft and that is only regarding the tools story. IBM
has been actively participating in forming standards, however, its products are two years into the
future.
Another key differentiator between Oracle and other major players is that Dynamic Services provides
an engine that can handle complex service exection flow. None of the players in the market place has
such an execution environment.
Dynamic Service Creation Assistant creates simple services. In the future it will also create compound
and failover services. It generates an XML service descriptor that includes An XML document, XSL
style sheets and XSD schema descriptors. It can be used by:
• Service developers
• Content providers
• Oracle Portal developers
Use the Dynamic Service Creation Assistant to:
• Select the Web site from which to obtain service information
• Specify the inputs required by the service
• Specify the results to be returned by the service
• Enter service definition information:
• Service Name: Self-documenting name for the service
• Service ID: Unique name used by Dynamic Services
• Description: Describe the function of the service
• Release Date: Service create date.
• Version: The version number of the service:
• Service Update URL: location of service provider’s current service definition
• Service Classification: LDAP category and related keywords
This step is only required if the category does not exist in the service registry.
The DSAdmin utility is a command line utility used to perform common administrative operations,
including:
• Register service packages
• Create new service categories
• Browse registered services
• Execute registered services
• Register new Web applications
• Unregister services
• Manage registered Web applications
• Manage access control list
It is run by executing the DSAdmin shell script or batch file which can be found in:
<ORACLE_HOME>\Ds\bin\dsadmin.bat for NT
%ORACLE_HOME/Ds/bin/dsadmin for UNIX
When you run this script, choose the direct driver to connect to a Dynamic Services engine running
inside a database. After doing so, the screen in the slide is displayed.
The DSAdmin utility is navigated by entering single character menu options on the command line.
After registering the category, return to the DSAdmin shell root by entering:
• X at the service management subshell
• X at registry operations.
Then, to enter registry operations, enter
• R to go to the registry operations
• S to manage services
When registering our service, specify the directory tree root that was previously created with the
Dynamic Services Creation Assistant.
The service registry is centrally stored in Oracle Internet Directory (OID) LDAP Server.
Before we can execute the newly created service, we must grant service execution privileges to
users.
An application must be registered in the Application Registry of the OID and associated with a user
that has been granted service execution privileges before it can access a service.
First, enter the consumer application management subshell within DSAdmin. To get there from the
service management subshell, enter:
• X at the service management subshell to return to the registry operations subshell
• C to enter the consumer application management subshell
• G to grant privileges
• 1 to grant privileges to a service
In the example:
• The user DSSYS is the name of the user receiving the privileges
• The ID of the newly created service is entered from the list of services displayed
Before we test the newly created service, we must create a sample request file. For the example on
the slide, the file contains the following lines of code:
<?xml version="1.0"?>
<form1 xmlns="http://quote.yahoo.com/Yahoo.com_Stock_quote/Reque
st"
xmlns:xsi="http://www.w3.org/1999/XMLSchema/instance"
xsi:schemalocation=
"http://quote.yahoo.com/Yahoo.com_Stock_quote/Request
http://quote.yahoo.com/Yahoo.com_Stock_quote/Request
Yahoo.com_Stock_quote_service_req.xsd">
<stocksymbol>ORCL</stocksymbol>
</form1>
In DSAdmin, to test the services, enter:
• X at the consumer application management subshell to return to the root of DSAdmin
• X at the registry subshell
• E to go into execution operations
• S to synchronously execute the service
• The number of the newly created service from the list of services
• The file specification of the XML request file
The output of the screen shows the response XML created by service execution. This XML includes
the stock quote information requested during service creation.
Services can also be browsed and tested from the graphical Management Console, a Java Server Page
(JSP) that allows administrators to browse registered services and execute services
• Services are
automatically
registered as
portlets in Oracle
Portal providing
transparent
access
• Requires the
Dynamic Services
Web Provider
Now that the services is created, it can be added to Oracle Portal. It is easy to view these results in a
Web page using Oracle Portal. To incorporate our dynamic service into a Web page:
• Login to Portal30 from a browser, using a URL similar to http://mypc.myco.com/pls
• Select Logon and use the default password for Portal30, which is Portal30
• Select the Build tab
• Select Build a New Page
• Go through the Oracle Portal page creation steps to build a new Web page:
• On the first page, enter a page name and title, and then select Next
• In Step 2 of 4, keep the defaults for the page layout and select Next
• In Step 3 of 4, add portlets to a region by selecting the Add Portlet icon and selecting
the newly created portlet from the list of portlets under the portlet provider list name
"Yahoo Stock Quote Service"
• After selecting OK, return to the Oracle Portal creation sequence, Step 3 of 4 and see that the
Yahoo.com stock quote portlet has been added
• To end this process, select Finish, unless you want to select non-default values at Step 4 of the
Creation Assistant
• If not already done, when prompted to customize the portlet on the Customize screen, enter
ORCL as the default stock symbol and select OK.
If a blank screen is displayed, look for error information in the apache log file:
<ORACLE_PORTAL_HOME>/apache/apache/logs/error_log
The probable reason for the blank screen is that privileges have not been granted to the DSSYS user to
execute Dynamic Services.
Oracle Dynamic Services New Features 2-12
Add the Service to an Application
A Simple Service
A Simple Service provides a uniform access method. It is described in an XML Service descriptor,
providing various properties about the resource to be accessed and the syntax of the service request
and response. Service requests and responses are XML documents, decoupling information access
from rendering.
Compound Services
Compound services let you encapsulate the execution of multiple services by combining them into a
directed graph of service executions. DSCompoundServiceExecutionAdaptorcoordinates the
execution of the modules according to the graph specifications, triggering the module executions
through JavaBeans events
Failover services
DSFailOverExecutionAdaptortakes as parameters an ordered list of compatible services,
which means the services respond to the same service interface. At execution time, the failover
execution adapter tries to execute the list in order, until it finds a service that executes with no
exception. If none succeed, an exception is raised.
Conditional services
DSConditionalExecutionAdaptorcontrols the flow of execution because it executes a
specified service based on the value of a certain defined alias. Service providers can configure the
adapter with switch statements that can be nested, to specify something like a decision tree, where the
leaf elements are the IDs of the services to execute.
Bundling Services
A service is bundled into a simple service package and structured as a local directory that contains files
that define the service.
Service Package
A Service Package is a local directory containing the following files:
• Manifest: text file that points to the service descriptor file
• ServiceDescriptor.xml: XML file containing pointers to the files listed below. It also
also describes in its service body section how the four types of service adapters are to be used:
Input Adapter, Output Adapter, Protocol Adapter, and Execution Adapter.
• myService-Classification.xml: XML file containing classification information for
the service from the service provider
• myService-Organization.xml: XML file containing Resource Provider information
about the organization
• myService-Contact_1.xml: XML file containing Resource Provider’s contact
information in the organization
• myService-Req.xsd: XML Schema Descriptor (XSD) file defining format of request data
• myService-Resp.xsd: XSD file defining format of response data
Compound Service Package
A compound service package contains multiple services and has everything a simple service package
has plus a JAR (Java archive) file containing all Java classes and property files needed by the
compound service. The JAR file, compoundService-Adaptors.jar, is only required for non-
simple services such as compound and failover services.
Oracle Dynamic Services New Features 3-4
Steps to Manually Create or Customize
A Simple Service Package
Lesson two described how the Service Creation Assistant and the ADMIN utility can be used to
quickly develop your own service.
Use the following steps to manually create or customize a simple service.
1. Create a service package using the example provided with the kit
2. Edit the service provider organization and contact XML files
3. Edit the service provider classification XML file
4. Create your XML schema file for the service request definition
5. Create your XML schema file for the service response definition
6. Edit the service descriptor file, including:
• Service header
• Service body sections
7. Test the execution of your service
See the Users Guide, chapter six for a complete example.
The service descriptor file also describes in its service body section how the four types of service
adapters are to be used to do any of the following:
• Input adapter: handles the submitted service request
• Protocol adapter: adapts the XML service request to the communication protocol used by the
remote service provider
• Execution adapter: determines the execution flow of a service
• Output adapter: transforms the raw response returned by the remote service provider into a
service XML response
The execution adapter specification identifies the way in which the service has to be executed. It
receives the request XML schema file and returns the response from the underlying service provider.
The default execution adapter is a standard simple adapter. There can also be complex or compound
execution adapters that aggregate several services.
For the identified adapter, the service provider has the option of specifying some adapter-specific
parameters in the PARAMETERS element in the adapter specification, which are validated at service
registration time and interpreted at runtime by the adapter.
The result of the execution adapter is the response from the service. If the service is a simple service,
the response will be in the native format of the service provider.
For example, for a Web-based service, the response may be in HTML format. If the service is a
compound service, the response will be a structured service response.
Usually, if the service is a simple service, a service provider will use the default prepackaged simple
adapter.
For complex and compound service execution, the service provider can use the supplied compound
execution adapter or DSFailOverExecutionAdaptoror
DSConditionalExecutionAdaptorto greater advantage.
Compound Service
Service 1
XML XML
MsgSplitter MsgMerger
Service Service
Request Service 2 Response
DSCompoundServiceExecutionAdaptor coordinates
control of execution flow among the four
CompoundEAModules:
• compound.ServiceExecution: Executes one
service
• compound.MessageTransformer: Transforms
service messages to either requests or responses
• compound.MessageSplitter: Splits the service
request into multiple requests for parallel execution
• compound.MessageMerger: Combines the
responses from all the services into one response
There are four possible modules that can be used in an execution graph. Each of the modules is
designed as a JavaBean with exposed properties that are set at compound service design time and
persist through runtime to control execution. DSCompoundServiceExecutionAdaptor
coordinates the execution of the modules according to the graph specifications, triggering the
module executions through JavaBeans events. The four available modules are:
• oracle.ds.engine.ea.compound.ServiceExecutionexecutes one service. It
accepts an array of messages, interpreting them as requests, and produces another array of
messages composed of responses returned by the service executions.
• oracle.ds.engine.ea.compound.MessageTransformertransforms service
messages to either requests or responses. It takes an XSLT stylesheet as a property in its
properties element, and applies that XSLT stylesheet to all the incoming service messages to
produce a list of outgoing services messages.
• oracle.ds.engine.ea.compound.MessageSplittersplits the service request
into multiple requests for parallel execution with one or more transformations as needed using
XSLT stylesheets
• oracle.ds.engine.ea.compound.MessageMergercombines the responses from
all the services into one response and then applies an XSLT stylesheet to transform that
message.
gold
gold Service_
Service_
00
Switch
Switch on
on silver Service_1
silver Service_1
“customer.sta
“customer.sta
tus”
tus”
bronze
bronze Service_2
Service_2
Dynamic Services offers a persistent auditing feature in which events that can be thrown during
execution, can be monitored. The monitoring process involves triggering of services to be executed
upon receipt of a certain event. These services that get triggered are called monitor services. Events
can be logged into the database and queried by administrators.
The result of monitoring often leads to other services being triggered, such as failure notification.
The services that get triggered are called monitor services.
In addition to the DSAdmin command line utility, there is also an event monitor command-line tool
called dsmon, dsmon.bat on Windows NT. This tool lets you start and stop the event monitor and
have control over the output level of the messages during the execution of the monitor services.
Because Dynamic Services makes use of Oracle Advanced Queuing for delivering event messages,
you must also set the dynamic init.ora parameter AQ_TM_PROCESSES for your database instance
to a non-zero value.
Configure the MonitorInstall.dssfile in the etc/dsadmin directory to point to the
database where the monitor services will write information. Most of these monitor services are
database services that just load some processed information into tables. Make this the same database
as the one used for the Dynamic Services engine instance.
The script dsmoninstall.sql installs a set of default monitor services from the
etc/services directory as entries into tables under the DSSYS schema.
In addition to the DSAdmin command line utility, there is an event monitor command-line tool called
dsmon, or dsmon.bat on Windows NT. This tool lets you start and stop the event monitor, which
executes monitor services upon receipt of events published by the Dynamic Services engine. Monitor
services are services that are associated with a monitor and conform to a service interface called
EventHandlerTemplate.
Using the event monitor utility, you can connect to an Oracle Dynamic Services engine; start or stop
the monitor; and have control over the output level of the messages during the execution of the
monitor services.
The next step is to enable persistent auditing. With the default installation in dsinstall.sql,
event messages are disabled in the properties table. The example shows the setProperty PL/SQL
procedure calls that enable event logging for the logging and warning event types.
• Sample output:
TIME CNSMR OPERATN SERVICE STATUS
-------- ----- ------- --------------------------------- ------
12:05:20 DSSYS CONNECT OPEN
12:05:33 DSSYS LOOKUP OPEN
12:05:33 DSSYS LOOKUP CLOSE
12:05:36 DSSYS EXECUTE urn:com.cnnfn:finance.portfolio03 OPEN
12:05:53 DSSYS EXECUTE urn:com.cnnfn:finance.portfolio03 CLOSE
12:06:23 DSSYS CONNECT CLOSE
One of the monitor services that is used is called the logger monitor service. It loads a logging event
message into a raw log table in the database. The example on the slide queries this table for messages.
In the slide, there are three operations. Each operation is opened and closed.
The first step is to ensure the OID directory is running. To start OID LDAP servers:
oidmon connect=OIDDB1 sleep=10 start
oidctl connect=OIDDB1 server=oidldapd instance=1 start
where OIDDB1 is the system identifier (SID) of the database instance created by the OID installer.
Run the ldapmodify command to install the Dynamic Services LDAP schema, using the input
file oiddsschema.ldif. This procedure creates Oracle Dynamic Services schema. The
ldapmodify command options include the following:
• -h is the host machine where OID is running, for example: oracledev1-
sun.us.oracle.com
• -p is the port number on which OID is listening, with a default of 389
• -D is the user name, for the default administrator for OID it is "cn=orcladmin"
• -w is the password for the user, for the default administrator for OID it is welcome
• -v runs the command in verbose mode, which displays additional information as the
command executes
• -c indicates that warning or error messages are viewed at the end of the command
• -f is the location of the schema file to be uploaded to OID.
Then create the default entries for Dynamic Services by using oiddsdt.ldif. This script file
creates Oracle Dynamic Services attributes, an index on those attributes, and object classes.
To enable an instance of the Dynamic Services engine to communicates with the master OID server,
you must change some properties in the properties table. This is done in the script ds_ldap.sql.
On the slide, the first call instructs the instance to go to an OID server for a master repository of the
registry rather than to itself. The default value that was set during installation is
oracle.ds.registry.DSSimpleRegistry.
The second call points your instance to the correct OID server for its registry communications.
Change your.ldap.server in the example to the host name of the machine that is running
Oracle Internet Directory.
Optional steps include:
• Run the DSAdmin utility and go to the DSAdminShell.Registry.Engine subshell to register
your engine with the master mirror repository. This step is needed only for management
purposes.
• Browse the DSAdminShell.Registry.Engine subshell to see the directives available to manage
the list of engines that communicate with the master mirror repository.