With Oracle9iAS v9.0.3, in addition to the existing
RPC-style Web Service, support has been extended to Document Style Web
Service. The following Document Style Web Services are supported
Stateless Java Document Style Web Service
Stateful Java Document Style Web Service
JMS Document Style Web service
For a stateful Java implementation, Oracle9iAS Web Services
allows a single Java instance to serve the Web Service requests from an
individual client. For a stateless Java implementation, Oracle9iAS Web
Services creates multiple instances of the Java class in a pool, any one
of which may be used to service a request. After servicing the request,
the object is returned to the pool for use by a subsequent request.
JMS Document Style Web Service exposes JMS destinations,
Queues and Topics, as Web Services, thereby enabling asynchronous invocations
by having these destinations consumed by a MDB in the back end.
This application shows how Oracle9iAS Web Services platform
can be used to develop and deploy JMS Document Style Web Services. It
also showcases the use of Oracle9i Web Services Assembly Tool, which aids
in assembling( also generates WSDL and Proxy stubs) Web Services.
Application Overview
This sample application revolves around a News Service
company ( "Daily Express" ) with around 200 branches across the globe.
The focus of this sample is on a single process, the news dispatching
process. The process is very simple, whenever any branch gets an important
news or information it has to be dispatched to all the other branches
of the company. The company also maintains a portal, where people can
browse the latest news online.
This application has three modules which constitute
the news dispatching process :
NewsService ( JMS Web Service )
Daily Express Application
NewsService Client ( JMS Web Service Clients )
NewsService ( JMS Web Service )
NewsService is the heart of the whole application. NewsService
is a JMS Document Style Web Service which exposes a JMS Queue ( News Queue
) as a Web Service. This service accepts messages ( clients send messages
by invoking the 'send()' operation of the Web Service ) ,extracts the
news content from the message, persists to the datasource and finally
publishes to a JMS Topic ( News Topic ).
The JMS Topic ( News Topic ) is also exposed as a JMS
Document Style Web Service and hence all clients can subscribe to this
Topic and receive news items. This is done by invoking the 'receive()'
operation of the Web Service.
Daily Express Application
DailyExpress is a web-portal hosted by the company.
This application enables Internet users to browse the latest news online.
It retrieves the latest news from the datasource and displays them to
the user. Users can also browse through news items based on categories
such as Sports, Health, Technology, etc.
NewsService Client ( JMS Web Service Clients )
The NewsService client applications are stand-alone
java applications that post/subscribe news to the NewsService Web Service.
PostToNewsService uses the proxy stub to post news to the Web Service
and ListenToNewsService subscribes to the Web Service and prints the received
news in the console.
Application Architecture
1) NewsService Client application posts a news message
by invoking the 'send()' operation on the 'NewsService' Web Service.
2) The News Queue (MDB) is invoked with the news message.
3) Extracts the news message from the payload and persists it to datasource.
4) Then, NewsQueueEJB publishes the news message to the News Topic.
5) News Topic delivers the news message to all the Web Service clients
who have subscribed by invoking the 'receive()' operation.
6) NewsService Client application receives the news message.