Web Services With Java EE 6: An Example Using Planning in Reverse
Web Services With Java EE 6: An Example Using Planning in Reverse
Web Services With Java EE 6: An Example Using Planning in Reverse
I. I NTRODUCTION
In the early part of 2011 this papers author was approached
by faculty members from Alvernia University for help in
the construction of an application that would assist the users
of a process they had developed. Concurrently, the author
had enrolled in a graduate level service-oriented architecture
(SOA) course intended to expose students to the utility of
constructing applications based on services. The nature of the
process defined by the Alvernia faculty lent itself well to a
service-oriented approach. Ballantyne, et al. [1] outlines the
need for a tool that actively incorporates all employees into
the planning process.
This book was written so that organizations
large and small, private and public, for profit and
not for profit school systems or colleges and universities can implement a process that includes all
stakeholders and employees in a meaningful role in
planning. It is designed so that all can be engaged
in the process and become part of the organizations
long-term viability by providing short-term observations.
After reading the book and conferring with its authors,
several key features of the process became evident. Successful implementation relies on gathering information that
is distributed among many stakeholders, resulting in a need
for different types of client-side interactions. Both small
and large organizations must be supported with equal utility,
making scalability a key non-functional requirement. As an
organization grows more adept at applying the process to its
unique needs, the tool must change to accommodate the new
knowledge. Finally, interaction must be ubiquitous, requiring
easy access from a diverse collection of client hardware.
Individually, each feature can be realized without giving much
ISBN: 978-1-61208-152-6
124
SERVICE COMPUTATION 2011 : The Third International Conferences on Advanced Service Computing
The initial step starts when an employee observes something they deem significant. News stories, newly available
technologies, changes in world affairs, and even casual
conversations that an employee feels could potentially
impacting the organization are recorded as an implication
scan.
Once recorded, these implication scans are evaluated by a
committee of strategic planners to determine their impact.
Impact can be significant or insignificant, and may also
be categorized as internal or external. Implications that
are deemed to have a material impact are advanced to the
next stage for further action.
Itemized action plans are developed to address the implications. These itemized action plans define a sequence of
steps for the organization to undertake to actively manage
the impact. The plans include both steps to take and the
logistics necessary to ensure the plan is successful.
Finally, the plan is rolled out and integrated into the
organization.
that they are not going to meet their annual operating profit,
they develop an itemized action plan to increase the sales
of an alternate product that will remain price competitive
while reducing the energy usage throughout the factory. This
itemized action plan is subsequently developed into an implementation plan by considering the logistics needs and defining
the timeline. Finally, the implementation plan is integrated into
the organization, and they are ultimately able to meet their
annual operating targets.
III. W EB S ERVICES
The term web services broadly refers to service-oriented
architectures where services are provided over transport mechanisms such as HTTP, and service clients are available as
webpages. As an architectural concept, SOA provides loose
coupling [5] between the implementation of business logic and
the consumers of those implementations. This loose coupling
also allows significant capacity for scaling, either through the
distribution of service endpoints across multiple platforms, or
through the scaling of business logic implementation using
multiple cores, distributed computation, or cloud computing.
Prolific use of Web services is largely the result of standards
that define the mechanisms of interface definition and service
invocation.
A. Web Services Definition Language
Fig. 1.
.
Figure 1 shows a more detailed view of the process outlined
within the text. Depending on the size organization, separate
committees may be formed to better meet demand. Also note
that implication scans can result in both positive (improvements) and negative (impediments) that must be dealt with.
B. PIR Example
To better understand the process flow consider the following
example. An employee reads a news article that oil prices are
likely to rise over $100 a barrel for the next 12 months. The
employee submits an implication scan. The scan is entered into
the system, and the next time the impact evaluation committee
meets, they review it. They determine that higher energy
prices will increase the overhead rates for their factory. These
increased overhead rates will make the product they produce
more expensive. The additional expense means their product
will not be price competitive within the market. Realizing
ISBN: 978-1-61208-152-6
Web Services Definition Language (WSDL) [6] is the primary mechanism used to define the interface to Web services.
Written using the Extensible Markup Language (XML), WSDLs provide a complete encapsulation of the service interface
available to the client. WSDL XML documents contain a
complete description, including the methods available from
the service and the data types that are exchanged. The key
elements within a WSDL are defined below. The collection
of information is a complete interface specification, allowing
programmatic discovery and use of the service.
PortType defines operations and their associated Messages.
Types
references an XML schema document used to define
datatype elements and the namespace.
Message defines a Web service method and Parts of the
message.
Parts
identify parameters used in invoking the service
method.
Binding binds each Operation with its transport mechanism
and datatypes.
Service binds the service name to the port and the physical
location at which the service may be found.
B. Simple Object Access Protocol
Simple Object Access Protocol1 [7] (SOAP) is an XML
specification that defines the structure of information passed
to and from Web service endpoints. Specified by the W3C
organization, the protocol is both prolific and well understood.
1 More recent versions of the specification have dropped the phrase, referring
only to the acryonym SOAP
125
SERVICE COMPUTATION 2011 : The Third International Conferences on Advanced Service Computing
SOAP messages provide client-initiated bidirectional communication with a service. A request is sent from the client to
the Web service endpoint, and a SOAP response containing the
information is returned from the Web service endpoint to the
client. Whereas WSDLs specify the interface to the service,
SOAP is used to transmit and receive service data.
C. Java support of Web Services
Traditionally, Web services have been developed using a
manual process. WSDLs were constructed by hand, requiring
a manual specification of each service endpoint and each operation. During development, the WSDL was manually updated
each time a change to an operation was made. Since the
resulting WSDL file is machine readable, a logical progression
was the development of tooling that generated these files
automatically and contained a mechanism to ease deployment.
Java provides a robust implementation of all of the necessary
components for Web service development.
D. Java 2 Enterprise Edition 6
The Java 2 Enterprise Edition 6 (J2EE 6) [8] specification
for enterprise-level Java ensures that the requisite facilities
for Web service development and deployment exist within
the platform. A comprehensive tutorial is available from the
Oracle website [9]. This tutorial includes information on nearly
every enterprise edition feature, including Web service development. Enterprise edition 6 is more than a simple collection
of compiler tools. This standard specifies services, libraries,
and many other facilities that are useful for enterprise-level
service deployment. J2EE 6 is not a specific implementation, but rather a specification that certified implementations
comply with. Until recently, compliant implementations were
only available commercially. However, with the release of
GlassFish Version 3 [10], an open source J2EE 6 compliant
implementation became available.
Java enterprise edition Web services are defined in JSR-109
[11]. This specification includes detailed information about
developing and consuming Web services within Java code. The
specification details how WSDLs and the services themselves
are accessed. A related specification, JSR-172 [12], details the
same thing for J2ME devices.
1) GlassFish: The GlassFish server bundles all of the
necessary elements to deploy Java enterprise applications,
including Java Web services applications. GlassFish provides
administration utilities, application containers, extensive scalability, database management and connection facilities, and
centralized user management. As a framework for deploying
large-scale enterprise applications, GlassFish contains all of
the necessary components in a single installation package. The
server itself may be deployed on both Windows and Linux
platforms, and is agnostic to the specific version or architecture
of the host operating system.
ISBN: 978-1-61208-152-6
126
SERVICE COMPUTATION 2011 : The Third International Conferences on Advanced Service Computing
ISBN: 978-1-61208-152-6
127
SERVICE COMPUTATION 2011 : The Third International Conferences on Advanced Service Computing
ISBN: 978-1-61208-152-6
Fig. 2.
PIR Architecture.
128
SERVICE COMPUTATION 2011 : The Third International Conferences on Advanced Service Computing
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
People person = em.find(People.class, person);
Implications impl = new Implications(0,
new java.util.Date(), trigger, false);
impl.setDescription(description);
impl.setUserId(person);
em.persist(impl);
em.getTransaction().commit();
em.close();
emf.close();
return impl.getId();
}
ISBN: 978-1-61208-152-6
Fig. 3.
.
Two primary client interfaces are required in the PIR
implementation, one on a desktop the other on a handheld
device. Though both rely on the same set of PIR services,
their intended purposes are different. The handheld application
is primarily used for implication scan submission and as a
mechanism to track progress. As a result, the interface is quite
simple, providing minimalist facilities to login, submit a scan
(title and description), and check status. These three actions
are collected in the applications menu.
The more complex application being developed allows
strategic planners to manage the PIR process. The author
elected to model the desktop-client user interaction as a
process flow that follows the PIR workflow. Figure 3 shows the
prototype desktop interface. The icons across the top represent
steps in the PIR process. Like the handheld client, the desktop
application uses the same core set of PIR services. Database
access and business logic is abstracted by the services to
provide a uniform interface.
G. Services
Below is a partial list of PIR functions decomposed into
services. These services are currently incomplete, but the list
provides insight into the basic functionality required. Perhaps
the most significant benefit of an SOA implementation is
the room for growth. As new functionality is identified that
will improve the organization, it can be incorporated into the
architecture with minimal impact.
submitScan: submit an Implication Scan for assessment.
129
SERVICE COMPUTATION 2011 : The Third International Conferences on Advanced Service Computing
ISBN: 978-1-61208-152-6
130