Vous êtes sur la page 1sur 6

Handout 45

Web Design & Development CS-506

Lecture 45

JavaServer Faces

In the last lecture, we have covered the basic nutshells of JSF. Having a belief on
“learning by doing”, in this lecture another example is also given to show you the
capabilities of JSF.

Example Code: Addition of Two Numbers


The example code (“AddNumbers”) is given along with the handout. It is strongly
advised that you must see the lecture video in order to learn the making plus working of
this example.

This example demonstrates the usage of value and method binding expressions, managed
beans, and how to use page navigation technique using IDE etc.

Web Services
In the remaining handout, we’ll take an overview of web services’ potential, their types
and working model. Resources are given at the end for those who are interested in
learning new technologies.

Introduction
Web services are Web-based enterprise applications that use open, XML-based standards
and transport protocols to exchange data with calling clients.

Web Service is becoming one of those overly overloaded buzzwords these days. Due to
their increasing popularity, Java platform Enterprise Edition (J2EE) provides the APIs
and tools you need to create and deploy interoperable web services and clients.

Web service, Definition by W3C


W3C recently has come up with a decent definition of web services. According to W3C,
“A Web service is a software application identified by a URI, whose interfaces and
binding are capable of being defined, described and discovered by XML artifacts and
supports direct interactions with other software applications using XML based messages
via internet-based protocols”.

Umair© 2006, All Rights Reserved -1-


Handout 45
Web Design & Development CS-506

Distributed Computing Evolution


Let's think a little bit on how distributed computing technology has evolved.

In the beginning, things were built and deployed typically in the form of client and server
model in which clients talk to a single server, for example, remote procedure calls (RPC).

The second phase can be called web-based computing in which many clients talk to many
servers through the net. In this phase, communicating partners still have to go through
some pre-arrangement in terms of what common object model they have to use or what
common communication protocol they have to agree upon.

Finally, the web services model in which service users and service providers can be
dynamically connected. And the pretty much every computing device and application
participates as both service user and service provider.

Characteristics of Web services


Web services are XML-based throughout. Pretty much everything in the domain of Web
services is defined in XML. For example, the format of the data being exchanged
between service user and service provider is defined in XML or the description of web
service is defined in XML.

Because the only contract that has to be agreed upon between service user and service
provider is syntax and semantics of XML messages, as long as valid messages can be
generated and understood, it does not matter what programming language is used. So a
web service is said to be programming language independent.

Web services can be dynamically located and invoked. And typically they will be
accessed and invoked over both internet and intranet.

Umair© 2006, All Rights Reserved -2-


Handout 45
Web Design & Development CS-506

Why Web services?


ƒ Interoperable
Connect across heterogeneous networks using ubiquitous web-based standards
ƒ Economical
Recycle components, no installation and tight integration of software
ƒ Automatic
No human intervention required even for highly complex transactions
ƒ Accessible
Legacy assets & internal apps are exposed and accessible on the web
ƒ Available
Services on any device, anywhere, anytime
ƒ Scalable
No limits on scope of applications and amount of heterogeneous applications

Types of Web service


ƒ Data providers
For example, a service providing stock quotes
ƒ Business-to-business process integration
For example, purchase orders
ƒ Enterprise application integration
Different applications work together simply by adding a webservice wrapper

Comparison between Web page & Web service


Just to give you a sense on the difference between a web page and a web service,
consider the following table:

Web page Web Service


Has a UI No GUI
Interacts with user Interacts with application
Works with web browser client Works with any type of client

Umair© 2006, All Rights Reserved -3-


Handout 45
Web Design & Development CS-506

Web service Architectural Components


Following are the core building blocks of web service architecture.
ƒ Service Description – how do clients know how it works (which functions,
parameters etc.)?
At the minimum, you need a standard way of describing a web service that is
universally understood by all potential service users and service providers. This is
important because without commonly agreed upon description of service, a
service provider might have to produce individually tailored way of describing its
service to all its potential service users.

Web Service Description Language (WSDL pronounced as viz-dal) is industry


agreed upon XML language that can be used to describe web service. It provides
XML format for describing web services in terms of methods, properties, data
types and protocols.

ƒ Service Registration (Publication) and Discovery


There has to be registry by which a service can be published and discovered.

Universal Description, Discovery & Integration (UDDI), a way to publish and


find web services. A repository of web services on the internet where a machine
or a human can find different web services. www.uddi.org

ƒ Service Invocation
Then there has to be standard way of invoking a service. Finally, for business
transactions in which secure and reliable message delivery is important, there has
to be a standard electronic business framework.

The following figure represents simplified web service architecture and summarizes the
working of web services:

----------------

Umair© 2006, All Rights Reserved -4-


Handout 45
Web Design & Development CS-506

References:

ƒ Java A Lab Course by Umair Javed


ƒ Web services overview by sang shin

Umair© 2006, All Rights Reserved -5-


Handout 45
Web Design & Development CS-506

Resources:
ƒ An excellent resource for learning Java related technologies is:

http://www.apl.jhu.edu/~hall/java/

ƒ http://java.sun.com
ƒ http://www.javaworld.com
ƒ http://www.theserverside.com
ƒ http://www.jsfcentral.com
ƒ http://www.jspolympus.com
ƒ http://www.onjava.com

Umair© 2006, All Rights Reserved -6-

Vous aimerez peut-être aussi