공지사항 및 수업관련 내용 안내
수업 진행에 필요한 사항들
◦ 프로그래밍 언어 : Java
◦ 관련 서비스 : Apache, Tomcat, JSP, Servlet, IIS, ASP,
◦ DO NOT WAIT until end of semester.
휴강: 3월 10일
보강: 3월 14일, 17일 한 시간씩 연장 수업
Key elements of Web Services
You need to remember this picture.
Distributed System: Definition
A distributed system is a collection of independent computers that
appears to its users as a single coherent system
(1) hardware - autonomous computers
(2) software – users think they are dealing with a single system
Goals of Distributed Systems
• Allow users to access and share resources
- To hide the fact that its processes and resources are
physically distributed across multiple computers
- To offer services according to standard rules that
describe the syntax and semantics of those services
- E.g., specify interfaces using an interface definition
Openness of Distributed Systems
Open distributed system: Be able to interact with services from other
open systems, irrespective of the underlying environment:
• Systems should conform to well-defined interfaces
• Systems should support portability of applications
• Systems should easily interoperate
Achieving openness: At least make the distributed system independent
from heterogeneity of the underlying environment:
Stand alone System
◦ a method of computer processing in which different
parts of a program run simultaneously on two or
more computers that are communicating with each
other over a network. Distributed computing is a
type of segmented or parallel computing.
◦ processing in which different parts of a program
run simultaneously on two or more processors that
are part of the same computer.
Both types of processing require that a program be se
gmented—divided into sections that can run simultan
◦ distributed computing also requires that the division of the
program take into account the different environments on w
hich the different sections of the program will be running.
◦ For example, two computers are likely to have different file
systems and different hardware components.
Distributed computing is a natural result of using net
works to enable computers to communicate efficientl
◦ But distributed computing is distinct from computer networ
king or fragmented computing. T
◦ he latter refers to two or more computers interacting with e
ach other, but not, typically, sharing the processing of a sin
◦ The World Wide Web is an example of a network, but not an
example of distributed computing.
Architectures for Distributed programming
◦ Client-server — Smart client code contacts the server for
data, then formats and displays it to the user. Input at th
e client is committed back to the server when it represent
s a permanent change.
◦ 3-tier architecture — Three tier systems move the client i
ntelligence to a middle tier so that stateless clients can b
e used. This simplifies application deployment. Most web
applications are 3-Tier.
◦ Tightly coupled (clustered) — refers typically to a set of hi
ghly integrated machines that run the same process in pa
rallel, subdividing the task in parts that are made individu
ally by each one, and then put back together to make the
◦ Peer-to-peer — an architecture where there is no special
machine or machines that provide a service or manage th
e network resources. Instead all responsibilities are unifo
rmly divided among all machines, known as peers. Peers
can serve both as clients and servers.
• Basic model
• Application layering
• Client–Server architectures
Basic Client–Server Model (1/2)
• There are processes offering services (servers)
• There are processes that use services (clients)
• Clients and servers can be distributed across different machines
• Clients follow request/reply model with respect to using services
Basic Client–Server Model (2/2)
Servers: Generally provide services related to a shared resource:
• Servers for file systems, databases, implementation repositories, etc.
• Servers for shared, linked documents (Web, VoD)
• Servers for shared applications
• Servers for shared distributed objects
Clients: Allow remote service access:
• Programming interface transforming client‟s local service calls to
• Devices with (relatively simple) digital components (barcode readers,
teller machines, hand-held phones)
• Computers providing independent user interfaces for specific services
• Computers providing an integrated user interface for related services
Application Layering (1/2)
Traditional three-layered view:
• User-interface layer contains units for an application‟s user interface
• Processing layer contains the functions of an application, i.e. without
• Data layer contains the data that a client wants to manipulate through
the application components
Observation: This layering is found in many distributed information
systems, using traditional database technology and accompanying
Application Layering (2/2)
Single-tiered: dumb terminal/mainframe configuration
Two-tiered: client/single server configuration
Three-tiered: each layer on separate machine
Traditional two-tiered configurations:
Distributed computing protocols
◦ OMG (Object Management Group)의 CORBA
◦ Microsoft의 DCOM
◦ Sun의 RMI
RPC (Remote Procedure Call):
◦ Client and application program call remote procedure in different
computer by using above protocols.
◦ Client make connection with server and execute server side procedures
◦ During maintain connection, server waiting for request from client and
return results when request is made.
Remote Client Remote server
Request for remote
Program Return resulta Procedure
1. Maintain connection
◦ Can not properly handle situation when client/server
connection has been lost
2. Waste Resources
◦ Connected clients with un-active status will hold valuable
resources (memory, connection)
◦ Most of time connection oriented protocols can not go
through firewalls. Especially security is very critical these
◦ All uses different protocols. Lack of comparability between
different protocols. They can communicates each other only
if they uses same protocol.
◦ Ex: RMI client only can connect to a server that has RMI
protocol on it.
A computer systems architectural style
◦ for creating and using business processes,
packaged as services.
SOA also defines and provisions the IT
infrastructure to allow different applications
to exchange data and participate in business
These functions are loosely coupled with the
operating systems and programming
languages underlying the applications.
SOA separates functions into distinct units
(services), which can be distributed over a
network and can be combined and reused to
create business applications.
These services communicate with each other
by passing data from one service to another,
or by coordinating an activity between two or
I like to build new “housing find services
(http://www.housingmaps.com/)” using “google
map” and “Housing information (text based)”
What we should do?
◦ We already have “google map (http://maps.google.com/)”
◦ Housing Information
Using existing two applications we like to
make new application like this.
Required the developers from Housing Maps
to have close ties with both Google and
Craigslist to figure out how to build, integrate
and manage the three applications.
The coordination of technologies, versions
and processes to build and keep the
composite application working would have
been hard if not impossible.
What happen if Google or Craigslist change or
upgrade their system?
• By using standard
interface, It is easy to
integrate two different
• Even Google and
Craigslist change or
upgrade their system,
it will not change any
• Technologies like
Standard Interface Standard Interface
XML, Web services,
and others make this Google Map
possible. Service Service
Key elements of Web Services
You need to remember this picture.
Information on a website is intended for
Information which is avaliable through a Web
Services will always be accessed by software,
never directly by a human.
Even though Web Services rely heavily on
existing Web technologies (such as HTTP),
they have no relation to web browsers and
UDDI Spec. UDDI Spec.
UDDI: Universal Description, Discovery and
◦ a platform-independent, XML-based registry for businesses
worldwide to list themselves on the Internet.
◦ an open industry initiative, sponsored by OASIS, enabling
businesses to publish service listings and discover each
other and define how the services or software applications
interact over the Internet.
WSDL: Web Service Description Language
◦ an XML-based service description on how to communicate u
sing web service.
◦ The WSDL defines services as collections of network endpoin
ts, or ports. WSDL specification provides an XML format for d
ocuments for this purpose.
SOAP: Simple Object Access Protocol
◦ a protocol for exchanging XML-based messages over
computer networks, normally using HTTP.
◦ SOAP forms the foundation layer of the Web services stack,
providing a basic messaging framework that more abstract
layers can build on. 30
2. Get WSDL URL 1. Publish service description
and WSDL URL
3. Request WSDL
4. Send WSDL Web Service System
Java, VB, C++, C#
Application Program 5. Call Remote Procedure
SOAP Message Remote Procedure
6. Return result in SOAP message
To put it quit simply, they are yet another
distributed computing technology (like CORBA, RMI,
They allow us to create client/server applications.
◦ Problem: keep a database with up-to-date information
about weather in the USA, and I want to distribute that
information to anyone in the world.
◦ Solution: To do so, I could publish the weather information
through a Web service that, given a ZIP code, will provide
the weather information for that ZIP code.
Get weather information Server
for ZIP code 12345
Cloudy with a chance of
We can do previous example with RMI, CORBA, EJB, and
countless other technologies!!
Web Services are platform-independent and language-
independent, since they use standard XML languages.
◦ This means that our client program can be developed in C++ and
running under Windows, while the Web service is programmed in
Java and running under Linux.
Most Web Services use HTTP for transmitting messages (such
as the service request and response).
◦ This is major advantage if you want to build an Internet-scale
application, since most of the Internet‟s proxies and firewalls
won‟t mess with HTTP traffic.
They lend themselves naturally to build loosely coupled
systems. These types of systems are more scalable than
strongly coupled systems, and impose fewer architectural
requirements on the actual implementation of the Web
◦ Suffice it to say that the reason why Web Services are ideal to
build loosely coupled systems is because they are message-
oriented and rely on language-neutral XML dialects to send
messages, to specify interfaces, etc.
Overhead. Transmitting all your data in XML is
obviously not as efficient as using a proprietary
binary code. What you win in portability, you lose
in efficiency. Even so, this overhead is usually
acceptable for most applications, but you will
probably never find a critical real-time application
that uses Web Services.
Lack of maturity. Web Services are relatively new
and, although the core specifications tat deal with
fundamental languages (XML, WSDL, …) and
protocols (HTTP, SOAP, …) are pretty stable, the
world of Web Services is still evolving at a fast pace.
Standards dealing with more advanced capabilities
expected from distributed systems, such as
transactions, security, etc. are either very new or
still in the work. 34
Where can I find a
(1) “weather service”? Discovery
We finally know There‟s a Web
A client may have no where the “weather service” (2)
Service is locatedIn and how
knowledge of what Web server Bto
invoke it. The invocation itself
service it is going to The discovery service
is So, our a language called
invoke. done in first will The Web service will us
will reply, telling
be to SOAP. Therefore, we will exactly should I kindly reply with a SOAP
discover a Web what services can
Client a meetsrequest asking for
Service that SOAP our
send response which includes
provide us the service
requirements. theforecast of a Web service, but we require. asked
the weather location of a
We now know
Take a look at this: WSDL or maybe an error
have certain cityhow to actually invoke it. Sure,for,
no idea of we
message is our
know it can give me the forecast for a US city, but how Web SOAP
request was incorrect.
do we perform the actual service invocation? The The Web Service replies
method I have to(5) invoke might be called “string in a language called
With parameter „12345‟
getCityPostalCode(int CityPostalCode)”, but it could WSDL.
also be called “sring getUSCityWeather(string citName,
SOAP response: (6)
bool isFarenheit)”. We have to ask the Web service to
“Cloudy with chance of
describe itself (i.e. tell us exactly how we should
invoke it). 35
Discovery UDDI Discovery, aggregation, etc.
Description WSDL Web Services description language
The most popular invocation protocol is SOAP
XML messaging SOAP But we could, in theory, use other protocols.
The most popular transport protocol is HTTP,
Transport HTTP But we could, in theory, use other protocols.
◦ This layer is responsible for centralizing services
into a common registry, and providing easy
publish/find functionality. Currently, service
discovery is handled via Universal Description,
Discovery, and Integration (UDDI)
◦ One of the most interesting features of Web
services is that they are self-describing. This
means that, once you‟ve located a Web service,
you can ask it to „describe itself‟ and tell you what
operations it supports and how to invoke it. This
is handled by the Web Services Description
◦ This layer is responsible for encoding messages in a
common XML format so that messages can be understood
at either end. Currently, this layer includes XML-RPC and
◦ This layer is responsible for transporting messages
between applications. Currently, this layer includes
hypertext transfer protocol (HTTP), Simple Mail Transfer
Protocol (SMTP), file transfer protocol (FTP), and newer
Web pages only have
The same information
is provided for all
<title>Best Auto Insurance</title>
<body bgcolor="#FFFFFF" text="#000000">
Please locate your estimated auto insurance quote by locating the most
similar car type and price together with your home location: <p>
4-Door Sedan (Price: approximately $12,000)<p>
Zipcode: 02139 : $ 2,000<p>
Zipcode: 02138 : $ 2,150<p>
A web page-based auto insurance site has many
◦ The page must include all types of cars and all zip codes,
which makes the page very long and cramped
◦ The overflow of information on the page makes it difficult to
read and use
◦ The page does not look nice, clean, and aesthetically pleasing
Instead of listing ALL of the information on a page, a
better idea is to allow the user to enter his particular
information, and have the particular result calculated
and displayed on the page
◦ The motivation for Web Applications
1. The user enters their car’s information into the browser
2. The Web application running on the
server processes the information about
the user’s car and calculates an
estimated insurance premium.
3. The user sees the estimated insurance
premium on the browser.
The process is easy, fast, and simple.
Manufacturing Means of Communications
human Web site interaction
Company 1 Company 2
Supplier 1 Supplier 2
Means of Communications
Very Best Auto Insurance phone
human Web site interaction
Auto Insurance Auto Insurance
Company 1 Company 2
Auto Insurance Company 1
Very Best Auto Insurance
Auto Insurance Company 2
amazon Web Services