28
1 THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering EIE424 EIE424 Distributed Systems and Distributed Systems and Network Programming Network Programming Part-II Part-II Case Study: Web Services Case Study: Web Services Lecturer: Lecturer: Dr. Daniel Pak-Kong LUN Dr. Daniel Pak-Kong LUN Room: Room: DE637 DE637 Tel: Tel: 27666255 27666255 E-Mail: E-Mail: [email protected] [email protected] Web page: Web page: www.eie.polyu.edu.hk/~enpklun/ www.eie.polyu.edu.hk/~enpklun/ EIE424/EIE424.html EIE424/EIE424.html

THE HONG KONG POLYTECHNIC UNIVERSITY

  • Upload
    wayde

  • View
    66

  • Download
    4

Embed Size (px)

DESCRIPTION

THE HONG KONG POLYTECHNIC UNIVERSITY. Department of Electronic and Information Engineering. EIE424 Distributed Systems and Network Programming Part-II Case Study: Web Services. Lecturer: Dr. Daniel Pak-Kong LUN. Room: DE637 Tel: 27666255 E-Mail: [email protected]. - PowerPoint PPT Presentation

Citation preview

Page 1: THE HONG KONG  POLYTECHNIC UNIVERSITY

1

THE HONG KONG POLYTECHNIC UNIVERSITYDepartment of Electronic and Information Engineering

EIE424EIE424 Distributed Systems and Network Distributed Systems and Network

Programming Programming Part-IIPart-II

Case Study: Web ServicesCase Study: Web Services

Lecturer:Lecturer: Dr. Daniel Pak-Kong LUNDr. Daniel Pak-Kong LUN

Room:Room: DE637DE637 Tel:Tel: 27666255 27666255E-Mail:E-Mail: [email protected]@polyu.edu.hkWeb page:Web page: www.eie.polyu.edu.hk/~enpklun/www.eie.polyu.edu.hk/~enpklun/

EIE424/EIE424.htmlEIE424/EIE424.html

Page 2: THE HONG KONG  POLYTECHNIC UNIVERSITY

2

THE HONG KONG POLYTECHNIC UNIVERSITYDepartment of Electronic and Information Engineering

Contents Introduction to Web Services XML-RPC SOAP WSDL UDDI Security issues in Web Services

Page 3: THE HONG KONG  POLYTECHNIC UNIVERSITY

3

References

Ethan Cerami, Web Services Essentials, O’Reilly, 2002.

U.Wahli, G.G. Ochoa, S. Cocasse and M. Muetschard, WebSphere Version 5.1 Web Services Handbook, IBM Redbooks, 2nd Ed, 2004

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Page 4: THE HONG KONG  POLYTECHNIC UNIVERSITY

4

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Introduction to Distributed Systems Distributed systems have been the development

trend of current computer systems A distributed system consists of a collection of

autonomous computers – linked by a computer network– equipped with distributed software

Offer many advantages comparing with a centralized multi-user system– Better price / performance ratio– Fault tolerance– Modular expandability

Page 5: THE HONG KONG  POLYTECHNIC UNIVERSITY

5

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Mainframe or Minicomputer

Terminals

Centralized Multi-user System (popular in 80’s)

Network

Problems: Single point of failureExpansive development and maintenance costDifficult to expand

Page 6: THE HONG KONG  POLYTECHNIC UNIVERSITY

6

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Distributed SystemsHeterogeneous type of computers

Servers and databases

Network

Page 7: THE HONG KONG  POLYTECHNIC UNIVERSITY

7

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Difficulties of Developing a Distributed System For a distributed system to function correctly,

application components (e.g. objects) executing on different computers throughout a network must be able to communicate

In 80’s, no formal way was provided to allow communication between application components running in different computing platforms– E.g. a Unix application could never talk with a DOS

application

Page 8: THE HONG KONG  POLYTECHNIC UNIVERSITY

8

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Start to be aware of the problem in early 90’s Many companies and organizations began developing

technologies to enable communication between distributed components, e.g.– OMG’s CORBA– Microsoft’s DCOM– Sun Microsystem’s RMI– IBM’s DSOM

Businesses could use these technologies to integrate applications with business partners’ computer systems

Page 9: THE HONG KONG  POLYTECHNIC UNIVERSITY

9

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Problem: Interoperability among these technologies was still limited

E.g. DCOM and CORBA cannot communicate easily May need a DCOM/CORBA bridge to allow

communication If DCOM’s or CORBA’s underlying protocols

change, programmers must modify the bridge to reflect the change

Hence not transparent to programmers

Page 10: THE HONG KONG  POLYTECHNIC UNIVERSITY

10

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Emergence of Web Services Web Services improve distributed computing

capabilities by addressing the issue of limited interoperability

Unlike DCOM and CORBA, use open standards (nonproprietary)

In 1999, HP first introduces the concept of Web Services in their product e-Speak, however the underlying technologies is still proprietary

In June 2000, Microsoft coined the actual term “Web Services” as a key component of its .Net

Page 11: THE HONG KONG  POLYTECHNIC UNIVERSITY

11

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Currently many competing frameworks and proposals for Web Services

Three main contenders:– Microsoft’s .NET– IBM Web Services– SUN’s Java System (or formerly Open Net Environment (ONE))

They all share the basic Web Services definition and vision

All of the frameworks share a common set of technologies, mainly SOAP, WSDL, and UDDI

Page 12: THE HONG KONG  POLYTECHNIC UNIVERSITY

12

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Advantages of Web Services Use open standards

– Enable components written in different languages and for different platforms to communicate

Use modular approach– The same Web Services can be used for different

applications and different companies Comparatively inexpensive to implement

– Use the Web Can be implemented incrementally

– Allow easier startup

Page 13: THE HONG KONG  POLYTECHNIC UNIVERSITY

13

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

What exactly is a Web Service? A Web Service is a service on the Internet that

– Use a standardized XML messaging system– Not tied to any one operating system or

programming language Optional features

– Self-describing: provide public interface to the service via a common XML grammer

– Discoverable: Interested parties can find a service and locate its interface

Page 14: THE HONG KONG  POLYTECHNIC UNIVERSITY

14

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

A Basic Web Service

XML-RPCSOAPHTTP GET/POST

Page 15: THE HONG KONG  POLYTECHNIC UNIVERSITY

15

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Human-Centric vs Application-Centric Traditional web applications are human centric

– Humans are the primary actors initiating most web requests

Web Server

HTTP GET:

HTTP response with HTML page:

Page 16: THE HONG KONG  POLYTECHNIC UNIVERSITY

16

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

With web services, we move from a human-centric Web to an application-centric Web– Conversation takes place directly between

applications as easily as between web browsers and servers

Web Server

XML Request:

XML Response:

Application

On to other applications

Page 17: THE HONG KONG  POLYTECHNIC UNIVERSITY

17

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Web Services Vision: Automated Web In the long term, Web services offer the

promise of the automated Web, or “just-in-time” application integration

Service Registry

Web Server

1. Discover services2. Ask for service description3. Receive service description4. Invoke remote service5. Obtain results

Application

Page 18: THE HONG KONG  POLYTECHNIC UNIVERSITY

18

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Automated Web: Example Travel agencies have been making use of Web

Services to automate the ticket booking services A customer can make on a Web site various

bookings such as flight ticket, car rental, hotel room, etc. at one shot

Based on Web Services, business data can be passed from one party to another

A final plan will be devised that meets the schedule and budget of the customer

Page 19: THE HONG KONG  POLYTECHNIC UNIVERSITY

19

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Service Registry

Web Server of Company A

Web Server of Company B

Web server of Company C

Web servicegateway

A’s App Server for generating a package for flight ticket

A: Flight ticketB: Car RentalC: Hotel Booking

B’s App Server for generating a package for car rental

• Customer makes specifications on schedule, budget ranges, and other specific requirements (e.g. non-smoking room etc.)

• System responses him with a list packages for him to choose

C’s App Server for generating a package for hotel room

Page 20: THE HONG KONG  POLYTECHNIC UNIVERSITY

20

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Real Life Example – Providence Health System Providence Health System - a system of hospitals, clinics and

assisted-living complexes in the Northwest, USA with over 600,000 members

Launch a Web Service project for some years to make medical and other records, which are spread across disparate systems, accessible to patients and physicians

The system aggregates data from 27 physician offices Those offices store their data in back-end billing, clinical laboratory

and ambulatory care record systems in 10 Oracle databases Providence maintains on its network

Save more than $1 million per year and lead to better patient care and potentially save lives

Page 21: THE HONG KONG  POLYTECHNIC UNIVERSITY

21

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

VitalWorks Enterprise Practice manager

Logician Patient Record System

Eclipsys Master Patient Index

System

ER doctor Primary care physicianVignette portal server

Web services gateway built on Infravio software

“Data mart” built on Oracle databases

Page 22: THE HONG KONG  POLYTECHNIC UNIVERSITY

22

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

1. ER doctor uses portal to request info of a patient2. Web services gateway manages connection to portal and

kicks off Web service to collect info on patient from “data mart” and display them in portal

3. Behind the scenes, the “data mart” collects on 30-minute intervals the back-end physician systems that store the records

4. ER doctor is presented with a complete record from the patient’s primary care physician

5. Primary care physician can use the same portal interface and Web service to collect medical records for new or referral patients

Page 23: THE HONG KONG  POLYTECHNIC UNIVERSITY

23

Providence Health System is an internal system Will have exploited the full power of Web Services

when other external healthcare organizations work together to jointly provide the services

However, a more stringent security measure needs to be devised to protect patients’ data

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Remarks

Page 24: THE HONG KONG  POLYTECHNIC UNIVERSITY

24

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

With Web Services, most of the above processes can be automated

However, there is no mechanism for automating business relationships

Human intervention is still required in– Price bargaining– Negotiation on delivery schedule– Legal ramifications if deliveries are not made– Interaction when the deliverable has bug!

May not be easily solved hence “just-in-time” application integration may take time to achieve

Do we have Automated Web now?

Page 25: THE HONG KONG  POLYTECHNIC UNIVERSITY

25

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Web Service Architecture Three major roles within the web service architecture:

Service Provider– Implement the service and make it available on the Internet

Service Requestor– Utilize an existing web service by opening a network connection and sending an XML request

Service Registry

Service Provider

Service Requestor

Service Registry– Provide a central place where

developers can publish new services or find existing ones

1. Discover Service2. Invoke Service

Page 26: THE HONG KONG  POLYTECHNIC UNIVERSITY

26

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Web Service Protocol Stack

Discovery UDDI

Description WSDL

XML Messaging XML-RPC, SOAP,XML

Transport HTTP,SMTP,FTP, BEEP

Transporting XML messages between client and server

Encoding messages in XML format

Describing Web Services interface

Searching / Publishing Web Services

Page 27: THE HONG KONG  POLYTECHNIC UNIVERSITY

27

Deploying Web Services- Service Requestor Perspective

Step 1: Find services via UDDI

Step 2: Retrieve service description file:WSDL or XML-RPC instructions

Step 3: Create XML-RPC or SOAP Client

Step 4: Invoke remote service

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services

Page 28: THE HONG KONG  POLYTECHNIC UNIVERSITY

28

Deploying Web Services- Service Provider Perspective

Step 1: Create core functionality

Step 2: Create an XML-RPC or SOAP service wrapper

Step 3: Create WSDL service description or XML-RPC integration instructions

Step 4: Deploy service by, e.g. installing an App Server

Step 5: Register new service via UDDI

EIE424 Distributed Systems and Networking Programming –Part II1. Introduction to Web Services