Table of Contents
This sample is an e-Business application
that demonstrates Dynamic Invocation of Web Services. As we are aware,
Web Services allow heterogeneous applications to invoke published
methods through standard HTTP protocol. Most of the remote invocation
technologies in the past operated at binary level and required tight
coupling (Eg. Java RMI or CORBA) . However, Web Services have
revolutionized all this with the use of XML, SOAP and HTTP. Web
Services are loosely coupled because the data interchange happens in
XML format over HTTP. We have two options by which we can consume Web
Services
- Static Invocation
Static invocation uses pre-generated stub. This stub corresponds to
a WSDL specification agreed in advance.
- Dynamic Invocation
Dynamic invocation generates the stub at the time of the method invocation.
This stub is generated by parsing the WSDL document that describes the
Web Service.
Oracle9iAS
Web Services
Oracle
provides complete infrastructure for development and deployment of
Web Services. Oracle9i
JDeveloper allows
rapid development of Web Services. Oracle9iAS serves as
the hosting platform where Web Services are hosted. Oracle9iAS
containers for J2EE, an integral part of Oracle9iAS acts as the
container where Web Services are deployed. Oracle provides necessary
support classes that enable the developer to consume and develop a Web
Service with minimal effort.
Oracle9iAS
UDDI registry
As part of its Web
Services products stack Oracle provides its own UDDI (Universal
Description, Discovery and Integration) registry. Oracle's UDDI
implementation runs on top of Oracle9iAS. UDDI registry allows
service providers to publish their Web Services. UDDI registry allows
clients to search these Web Services and find the service and WSDL
url's. Once these locations are known, users can generate necessary
stubs and consume these Web Services.
More about this
application
This sample acts an
insurance portal. Since there are hundreds of insurance service
providers, people will always be interested in knowing if they are
getting the best deal in insurance premiums. This application creates
three vendors who sell insurance products. The only restriction on
participating service providers is that they must host one Web Service
that implements "QuoteService" interface. These service providers
should register their services in the UDDI registry so that this portal
can find all service providers.
This application
browses through UDDI registry and maintains a list of all insurance
vendors who provide "QuoteService". When user requests any information,
this portal generates the stubs necessary for service invocation
dynamically and retrieves the data. This data may be reformatted or
sorted so that users have up-to-date information about the insurance
products they are searching for.
When this sample is
installed, it creates 3 database users. These users correspond to 3
insurance service providers.
1. GoodLife
Insurance INC.
2. Fargo Insurance INC.
3. Western Insurance INC.
Every insurance
provider provides a "QuoteService" implementation, so, there are 3
"QuoteService" providers. WSDL url and Service url of each of these Web
Services is then added to UDDI registry along with related information.
This application is ready to run once UDDI enquiry url for the UDDI
registry is supplied to the QuoteAnalyzer component.
Users can go to the
home page of this portal and have following search options.
Generic Search:
- Get listing of
all car insurance plans from all vendors.
- Get listing of
all life insurance plans from all vendors.
- Get listing of
all health insurance plans from all vendors.
Vendor Search:
- Get listing of
all car insurance plans from a particular vendor.
- Get listing of
all life insurance plans from a particular vendor.
- Get listing of
all health insurance plans from a particular vendor.
Best Search:
- Get listing of
all car insurance plans sorted in ascending order with respect to their
premium.
- Get listing of
all life insurance plans sorted in ascending order with respect to
their premium.
- Get listing of
all health insurance plans sorted in ascending order with respect to
their premium.

This section shows the user a
glimpse of the application.
Login screen when the application
is invoked for the first time. (Ref Figure 1.1)
Figure
1.1

Refer to Install.html in the sample jar for
step-by-step instructions on extracting files,
installing and configuring any other systems to successfully run
this
application.
The directory structure of the deliverable
WebServiceDII.jar
will be as shown below
| File /
Directory name |
Description |
| doc / Readme.html |
This file |
| doc /
Install.html |
Instructions
for setting up this sample application on Oracle9iAS |
| sql / setup.sql |
SQL script
required for setting up the database required by this application. This
script must be run with SYSTEM privileges. It creates 3 users and
inserts necessary tables and data. |
| public_html directory |
This
directory contains JSP's and html pages required by this application. |
| public_html / images
directory |
This page
contains style sheet and images required by this application. |
|
src directory
|
This
directory contains sources of the classes used in this application. |
| DynamicStub.java
|
Dynamic stub
class provides a Java wrapper for "QuoteService" interface and Web
Services hosted by various insurance providers. |
|
FargoQuoteService.java
GoodLifeQuoteService.java
WesternQuoteService.java
|
These classes
are the Java implementations of the "QuoteService" interface. These
classes are exposed as WebServices. |
|
PolicyDetails.java
|
This is a
helper class.This
class is used to sort the results for BestSearch queries. This class is
also used to generate listings of insurance plans for other searches.
|
|
PublishServices.java
|
This class
publishes tModels, bindingTemplates, businessServices and
BusinessEntities in UDDI registry.
|
|
QuoteAnalyzer.java
|
This class
has support methods which offer following functionality
- Find all
[Car/Life/Health] insurance plans.
- Get the
"Best Quote" for all insurance categories.
- Find all
[Car/Life/Health] plans from a particular vendor.
|
|
QuoteService.java
|
This
interface must be supported by every insurance vendor who wants to
participate in the Insurance search services provided by BestInsurance
DII application. |
|
ServiceHandle.java
|
This class
searches UDDI registry to get all "QuoteService" implementations
registered in that registry. For every such implementation, a
DynamicStub instance is generated and stored in a Hashtable. |
|