Transcript pps

Slide 1

ICE0534 – Web-based Software Development

ICE1338 – Programming for WWW
- Summer 2005 -

Lecture #10
In-Young Ko
iko .AT. icu.ac.kr
Information and Communications University (ICU)


Slide 2

Announcements


Reading Questions #5 (for the Ph.D.
lecture) is due by Tuesday August 2nd


Summer 2005

Submit the homework to Mr. Byungsang Kim
(bskim .AT. icu.ac.kr)

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

2


Slide 3

Last Lecture


Internationalization



Technology Reviews
P3P [u11: Youngjin Ro]
 XML Signature [u12: Yoonjung choi]




Technology Surveys
Web security [g16: Jonggul Park]
 Grid Computing [g17.1: Youngjoo Han]


Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

3


Slide 4

This Lecture


Web Services







Technology Reviews





Web Services Architecture
SOAP (Simple Object Access Protocol)
WSDL (Web Services Description Language)
UDDI (Universal Description, Discovery and Integration)

SOAP [u13: Jongwook Lee]
WSDL [u14: Hyunho Park]

Technology Surveys




Summer 2005

UDDI [g19: Jongha Jung]
SOA (Service-oriented Architecture) [g20: Changsup Keum]
Web-services Platforms [g21: Youngkyu Park]

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

4


Slide 5

Difficulties in Using Web Wrappers
http://websearch.naver.com/search.naver?where=w
ebkr&query=www&xc=&qt=df&f=all&r=&st=s&fd=1&
start=101&display=10&domain=&dftf=&qf=1&qvt=0







Summer 2005

ICE 0534/ICE1338 – WWW

Need to analyze
how to generate a
URL
Need to parse Web
pages to obtain
result data
Need to modify the
wrapper when the
result page format
is changed
© In-Young Ko, Information and Communications University

5


Slide 6

What would be better?


Access the Web site as if we call functions:
e.g., result = Naver.webSearch(“ICU”);
String[] titles = result.getTitles();
String[] urls = result.getURLs();





APIs are independent from the changes on the
layout of the result pages
Use standard protocols such as HTTP to
directly access the Web site from a program

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

6


Slide 7

Solution: Web Services
xmethods.com

Allow users to test Web
Services via a Webbased interface

Provides a list of
publicly available
Web Services

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

7


Slide 8

Web Services
Web services provide a standard means of interoperating
between different software applications, running on a variety of
platforms and/or frameworks [W3C]
External Users

Web Services Platform

WSDL, SOAP, UDDI

Services

External Software System
Software Components
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

8


Slide 9

Service-oriented Architectures (SOA)
SOA is a form of distributed systems architecture
that is composed of loosely coupled services,
which interact with each other by exchanging
messages
Service Request
Message

Service
Provider

Service
Consumer
Service Response
Message

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

9


Slide 10

SOA Properties


Logical view: The service is an abstracted, logical view of actual
programs, databases, business processes, etc., defined in terms of
what it does



Message orientation: The service is formally defined in terms of
the messages exchanged between provider agents and requester
agents, and not the properties of the agents



Description orientation: A service is described by machineprocessable meta data



Granularity: Services tend to use a small number of operations
with relatively large and complex messages



Network orientation: Services tend to be oriented toward use over
a network



Platform neutral: Messages are sent in a platform-neutral,
standardized format delivered through the interfaces (in XML)
http://www.w3.org/TR/ws-arch/

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

10


Slide 11

Benefits of Using Web Services


Inheriting the benefits of service-oriented
software development
Enable outsourcing services
 Adaptability, Scalability, Maintainability
 Abstraction, Loose coupling, Asynchrony, Agility






Standard-based solution
Ubiquitous services via the Web
Clean division between production and
delivery of service

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

11


Slide 12

Main Elements in Web Services
http://www.w3.org/TR/ws-arch/



An agent is a program acting on behalf of person or
organization; implements a Web service



A provider entity is the person or organization that
provides an appropriate agent to implement a service



A requester entity is a person or organization that
wishes to make use of a provider entity's Web service



A Web Services description is a machine-processable
specification of the Web service's interface, written in
WSDL



The semantics of a Web service is the shared
expectation about the behavior of the service (the
"contract" between the requester and the provider)

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

12


Slide 13

Engaging a Web Service

http://www.w3.org/TR/ws-arch/
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

13


Slide 14

RPC (Remote Procedure Call)



A method by which a client can invoke a procedure on a
remote server as if it were running on the client
Sun popularized RPCs in the 1980s for its Unix systems

1. A client process, known as a client stub, converts a
request from a local application into a common data
format
2. The request is then transported across a network to a
server stub
3. The server stub translates the request into a form the
server process can understand
4. Once the server process processes the request, the
procedure is reversed
http://www.nwfusion.com/details/783.html
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

14


Slide 15

RPC Model

Marshalling

Client Process

Server Process

Client
Routines

Server
Routines

(1)

(6)

(10)

(7)

(9)
(8)

Network
Routines

Summer 2005

ICE 0534/ICE1338 – WWW

Unmarshalling

Server
Stub

Client
Stub
(2)

(5)

(4)

Network
Routines

(3)

© In-Young Ko, Information and Communications University

15


Slide 16

RPC Examples


SunPRC




Java RMI (Remote Method Invocation)






Use of the XDR (External Data Representation)
standard for describing message formats
Use of Java interfaces for describing message
formats
Use of the Java object serialization for data
transmission

Web Services


Summer 2005

Use an XML-based mechanism (SOAP) for
describing message formats

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

16


Slide 17

Web Services and RPC


Web Services use an XML-based RPC
mechanism (called SOAP)

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

17


Slide 18

Web Services Standards


WSDL (Web Services Description Language)




DAML-S (DARPA Agent Markup Language for
Services)




Language for Describing Semantic Web Services

SOAP (Simple Object Access Protocol)




Language for Describing Functionality and I/O Data
of Web Services

Envelop for sending messages

UDDI (Universal Description Discovery and
Integration)


Summer 2005

Directory service for Web Services
ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

18


Slide 19

Web Services Architecture
SOAP Message
(Service Request in WSDL)

Service Consumer

Service Provider

4
5
SOAP Message
(Service Response)

1 SOAP Message
SOAP Message
(Queries)

2
3

SOAP Message
(Query Response in
WSDL)

(Service Description in
WSDL)

Directory Service
(UDDI)

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

19


Slide 20

SOAP




Provides a standard, extensible, composable
framework for packaging and exchanging XML
messages
Service Oriented Architecture Protocol:






Represents the information needed to invoke a service
or reflect the results of a service invocation
Contains the information specified in the service
interface definition

Simple Object Access Protocol:



Summer 2005

Represents a method invocation on a remote object
Represents the serialization of in the argument list of
that method that must be moved from the local
environment to the remote environment http://www.w3.org/TR/ws-arch/
ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

20


Slide 21

SOAP Elements








A required Envelope element that identifies the
XML document as a SOAP message
An optional Header element that contains
header information
A required Body element that contains call and
response information
An optional Fault element that provides
information about errors that occurred while
processing the message
http://www.w3schools.com/soap/

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

21


Slide 22

Skeleton SOAP Message

xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

...


...

...


http://www.w3schools.com/soap/

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

22


Slide 23

SOAP Example – Service Request

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">


X1lNZ…………………+Y9j
www
0
10
true

false
lang_ko
A SOAP message for
latin1
accessing the Google
latin1
Web Service



http://www.google.com/apis/
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

23


Slide 24

Web Service Request via HTTP
C:\>telnet api.google.com 80
POST /search/beta2 HTTP/1.0
Host: api.google.com
Accept: text/*
Content-type: text/xml
SOAPAction: urn:GoogleSearchAction
Content-length: 408
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">y>xmlns:gs="urn:GoogleSearch">X1lN… .. .. ..
Y9j
www010>truefalsee>latin1latin1oap:Envelope>
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

24


Slide 25

SOAP Example – Service Response
Result header

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">

SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

false
10
false
xsi:type="xsd:int">762000000

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

25


Slide 26

SOAP Example – Service Response
xsi:type="ns3:Array" ns3:arrayType="ns1:ResultElement[10]">

Web page
http://www.yahoo.com/
listing
32k


Top/Computers/Internet/Searching/Directories/Yahoo



Yahoo!

xsi:type="xsd:boolean">true
... Business… Media Newspapers, TV...
The first large scale directory of the
Internet...

Yahoo!

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

26


Slide 27

WSDL








Web Services Description Language
An XML-based language for describing Web services
Submitted as a W3C Note by Ariba, IBM and Microsoft
for the W3C XML Activity in March 2001
Defines the message formats, datatypes, transport
protocols, and transport serialization formats that should
be used between the requester agent and the provider
agent
Represents an agreement governing the mechanics of
interacting with that service

http://www.w3.org/TR/ws-arch/
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

27


Slide 28

WSDL Description Levels


Abstract-level Descriptions: describe a Web service in
terms of the messages it sends and receives







An operation associates a message exchange pattern with one
or more messages
A message exchange pattern identifies the sequence and
cardinality of messages sent and/or received as well as who they
are logically sent to and/or received from
An interface groups together operations without any
commitment to transport or wire format

Concrete-level Descriptions:




A binding specifies transport and wire format details for one or
more interfaces
An endpoint associates a network address with a binding
A service groups together endpoints that implement a common
interface
http://www.w3.org/TR/wsdl20/

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

28


Slide 29

WSDL Document Structure


Main Elements:







The operations performed by the web
service
The messages used by the web service
The data types used by the web service
The communication protocols used by the
web service

Skeleton WSDL Document:


definition of types........
definition of a message....
definition of a port.......
definition of a binding....


Summer 2005

ICE 0534/ICE1338 – WWW






© In-Young Ko, Information and Communications University

29


Slide 30

WSDL Example














Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

30


Slide 31

WSDL Example (cont.)

transport="http://schemas.xmlsoap.org/soap/http"/>

soapAction="http://example.com/getTerm"/>








Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

31


Slide 32

Google WSDL
http://api.google.com/GoogleSearch.wsdl

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

32


Slide 33

Web Services Examples



WS Index: http://www.wsindex.org/Web_Services/index.html
XMethods (List of publicly available Web
Services): http://www.xmethods.com/










Summer 2005

Google search
Amazon.com
InstantMessageAlert
SendEmail
Global Weather
StockQuote
Air Fare Quote Search
BabelFish

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

33


Slide 34

The Problem with Web Services
How can I discover business partners
with compatible web service solutions?
 How do let other business know about my
exposed web services?




Web services are great, after you find out
about them, but the discovery process is
difficult
http://sern.ucalgary.ca/courses/CPSC/547/W2002/slides/uddi-wsdl.ppt

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

34


Slide 35

UDDI


Universal Description, Discovery and Integration



UDDI creates a standard interoperable platform that
enables humans and applications to quickly, easily, and
dynamically find and use Web services over the Internet



UDDI allows operational registries to be maintained for
different purposes in different contexts



UDDI is a cross-industry effort (UDDI.org) driven by major
platform and software providers, as well as marketplace
operators and e-business leaders

http://www.uddi.org/
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

35


Slide 36

UDDI Data



Entities: data structures that expressed in XML, and are
persistently stored by UDDI nodes
Entity Types:









Summer 2005

businessEntity: Describes a business or other organization that
typically provides Web services
businessService: Describes a collection of related Web services
offered by an organization
bindingTemplate: Describes the technical information necessary
to use a particular Web service
tModel: Describes a “technical model” such as a Web service
type, a protocol, or a category system
publisherAssertion: Describes, the relationship that the
businessEntity has with another businessEntity
subscription: Describes a standing request to keep track of
changes to the entities described by the subscription http://www.uddi.org/
ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

36


Slide 37

UDDI Example – Data Type Structure
businessKey="35AF7…..ACDD"
authorizedName="0100002CAL"
operator="www-3.ibm.com/services/uddi">
BooksToGo

The source for all professional books



Ramesh Mandava
(877)1111111



Taken from http://developer.java.sun.com/developer/technicalArticles/WebServices/WSPack/
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

37


Slide 38

Access UDDI via API’s


SOAP and XML Schema are the basis
UDDI Registry
Node

User
UDDI
SOAP Request

HTTP
Server

UDDI
SOAP Response

SOAP
Processor

UDDI
Registry Service

Create, View,
Update, and Delete
registrations

B2B Directory

Implementationneutral

© Copyright 2000 By Ariba, Inc., International Business Machines
Corporation and Microsoft Corporation. All Rights Reserved.

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

38


Slide 39

Web Services Stack

http://www-306.ibm.com/software/solutions/webservices/pdf/WSCA.pdf
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

39


Slide 40

Web Services Platforms


Provides facilities to support Web Servicesrelated activities
Service Description
 Service Implementation
 Service Publishing, Discovery and Binding
 Service Invocation and Execution




Examples
Microsoft .NET
 IBM’s WebSphere
 Sun’s J2EE (Java 2 Platform, Enterprise Ed.)


http://www.webservicesarchitect.com/content/articles/hanson01.asp
Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

40


Slide 41

Web Services References


W3C Web Services page: http://www.w3.org/2002/ws/



Web Services Architecture: http://www.w3.org/TR/wsarch/



Web Services Conceptual Architecture: http://www306.ibm.com/software/solutions/webservices/pdf/WSCA.pdf



Web Services Description Language (WSDL):
http://www.w3.org/TR/wsdl20/



WSDL Tutorial: http://www.w3schools.com/wsdl/default.asp



SOAP Tutorial: http://www.w3schools.com/soap/default.asp



SOAP Primer: http://www.w3.org/TR/soap12-part0/

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

41


Slide 42

Web Services References (cont.)


UDDI Technical White Paper:
http://www.uddi.org/pubs/Iru_UDDI_Technical_White_Paper.pdf



UDDI Spec Technical Committee Specification:
http://uddi.org/pubs/uddi-v3.0.1-20031014.htm



The Java Web Services Tutorial:
http://java.sun.com/webservices/docs/1.0/tutorial/




Microsoft .NET - http://www.microsoft.com/net/
IBM’s WebSphere http://www.ibm.com/software/info1/websphere/index.jsp



Sun’s J2EE (Java 2 Platform, Enterprise
Edition) - http://java.sun.com/j2ee/

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

42


Slide 43

Programming Homework #5


Due by Tuesday August 9th



Choose one of the Web Services (listed in Xmethods.com,
except Google) that accepts at least two inputs
Analyze the WSDL description of the Web Service and
identify how to access the Web Service
Develop a Web Service client program that












Accepts user’s inputs via a user interface (textual or graphical)
Generates a SOAP query based on the inputs
Connects to the Web Service and sends the SOAP query
Receives and parses the result SOAP-document
Displays the parsed results (in a textual or graphical user interface)

Extra Credit: Make a client program that accesses more
than one Web Services sequentially so that an output of a
Web Service is used by another Web Service as an input

Summer 2005

ICE 0534/ICE1338 – WWW

© In-Young Ko, Information and Communications University

43