web services: an introduction stuart fitz-gerald feb 2005

35
Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Post on 21-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services: an Introduction

Stuart Fitz-GeraldFeb 2005

Page 2: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 2

Overview

• Introducing Web services • The human-centric Web• The application-centric Web• The semantic Web

Page 3: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 3

Web services definition

“A Web service is any service that is available over the Internet, uses a standardised XML messaging system, and is not tied to any operating system or programming language.”

Ethan Cerami (2002)

Page 4: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 4

A Simple View

Page 5: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 5

Alternatives for XML messaging

There are several alternatives for XML messaging:

1. XML-RPC (Remote procedure calls)2. SOAP3. HTTP GET/POST

Page 6: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 6

Alternatives for XML messaging

Page 7: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 7

Additional desirable properties

• A Web service should be self-describing

• A Web service should be discoverable

Page 8: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 8

Self-Describing

If you publish a new Web service you should also publish an public interface to it. At a minimum , your service should include human-readable documentation that other developers can easily integrate into your service.

Page 9: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 9

Discoverable

If you create a Web service, there should be a relatively simple mechanism for you to publish this fact. Likewise, there should be some simple mechanism whereby interested parties can find the service and locate its public interface.

Page 10: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 10

A Complete Web service

Any service that:• Is available over the Internet or private (intranet)

networks• Uses a standardised XMLmessaging system• Is not tied to any one operating system• Is self-describing via a common XML grammar• Is discoverable via a simple find mechanism

Page 11: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 11

The Web Today: human centric

Page 12: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 12

The Web Today: human centric

The model illustrated on the previous slide illustrates the human-centric Web. In this humans are the principal actors initiating most Web requests. It also represents the primary model on which most of the Web operates today.

Page 13: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 13

Web services: application centric

With Web services we move from a human-centric Web to an application-centric Web. This does not mean that humans are entirely out of the picture. It just means that conversations can take directly between applications just as easily as browsers and servers.

Page 14: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 14

Web services: Examples

Examples of use:• Credit card verification• Package tracking• Shopping bots• Currency conversion• Language translation

Page 15: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 15

Web services and the Semantic Web

Tim Berners-Lee has argued for a Semantic Web. The Semantic Web vision is application-centric and shares many of the same ideas as Web services. In fact TBL views Web services as the actualisation of the Semantic Web vision.

http://www.sciam.com/2001/0501issue/0501berners-lee.html

Page 16: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 16

The Automated Web

An application-centric Web is not a new notion. For years developers have created CGI programs and Java servlets primarily for use by other applications eg

• Credit card services• Search systems• News retrieval systemsProblem? Most have been ad hoc solutions.

Page 17: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 17

The Automated Web

Web services offer the promise of some standardisation

“The Web services architecture provides an interesting alternative for drastically decoupling presentation from content. For example a site could consist of nothing but container pages that pass parameters to the real logic via SOAP or XML-RPC. This makes it easy to change presentation and also lets humans and computers share a single Web service.”

Page 18: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 18

The Automated Web

Consider the following example of a firm called ME wanting to buy product from Widgets, Inc. ME wants to integrate order status into an integrated inventory system. Here is the possible process:

1. The inventory application wakes up and connects to a centralised directory of Web services. The directory returns information on Widgets, Inc service and includes a pointer to the service description.

2. The inventory application connects to Widgets, Inc and retrieves the service description.

3. The description file includes complete details about how to connect to the specified service. The inventory application can automatically invoke the order status service.

Page 19: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 19

The Automated Web

Can this be fully automated using current Web services technology?

Not quite. It is possible to create Java programs to query service registeries.

Understanding the results still requires human intervention.

There is currently mechanism for automating business relationships.

Current Web services take us a step closer.

Page 20: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 20

The Automated Web

Page 21: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 21

Web service roles

There are three major roles within the Web services architecture:

• Service provider - The service provider implements the service and makes it available on the Internet

• Service requester - This is any consumer of the Web service. The requestor utilises an existing Web service by issuing an XML request

• Service registry - This is a logically centralised directory of services. The regsitry provides a central place where developers can publish new services and find existing ones.

Page 22: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 22

Web service roles

Page 23: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 23

Web service protocol stack

The protocol stack currently has four layers:1. Service transport - this layer is responsible for

transporting messages between applications. This includes HTTP, SMTP, FTP and BEEP (Blocks Extensible Exchange Protocol).

2. XML messaging - responsible for encoding messages. This includes XMPL-RPC and SOAP

3. Service Description - this is responsible for the public interface. Currently this falls WSDL.

4. Service Discovery - this layer is responsible for centralising services into a common registry and allows easy find. This falls to UDDI (Universal Discovery, Description and Integration)

Page 24: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 24

Web services protocol stack

Page 25: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 25

XML Messaging

When developers decided to build a Web service they chose XML given the vast array of XML tools, including parsers and editors for nearly every operating system and programming language this was a natural choice.

There are two main contenders for XML messaging:

• XML-RPC• SOAP

Page 26: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 26

XML Messaging

XML-RPC is a simple protocol that uses XML messages to perform RPCs.

Requests are encoded in XML and sent via HTTP POST.

XML responses are embedded in the body of the HTTP response.

Because XML-RPC is platform independent, it allows diverse applications to communicate

For example a Java client can speak XML-RPC to a Perl server.

Page 27: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 27

XML-RPC request

<?xml version=“1.” encoding=“ISO-8859-1”?><methodCall>

<methodName>weather.getWeather</methodname><params>

<param><value>10016</value></param><params>

</methodcall>

Page 28: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 28

XML-RPC response

<?xml version=“1.” encoding=“ISO-8859-1”?><methodResponse>

<params> <param> <value><int>65</int></value> </param>

</params></methodResponse>

Page 29: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 29

SOAP

SOAP is an XML based protocol for exchanging information between computers.

Although SOAP can be used in a variety of messaging systems and can be delivered via a variety of transport protocols, the main focus of SOAP is RPCs transported via HTTP.

Like XML-RPC, SOAP is platform-independent and therefore enables diverse applications to communicate.

Page 30: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 30

SOAP Request

?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <ns1:getWeather xmlns:ns1="urn:examples:weatherservice" SOAP-ENV:encodingStyle="http://www.w3.org/2001/09/soap-

encoding/"> <zipcode xsi:type="xsd:string">10016</zipcode> </ns1:getWeather> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Page 31: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 31

SOAP Response

<?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <ns1:getWeatherResponse xmlns:ns1="urn:examples:weatherservice" SOAP-ENV:encodingStyle="http://www.w3.org/2001/09/soap-

encoding/"> <return xsi:type="xsd:int">65</return> </ns1:getWeatherResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Page 32: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 32

Web Service Description Language

WSDL currently represents the service description within the Web service protocol stack.

WSDL is an XML grammar for specifying a public interface to the Web service.

This public face can include information on all publicly available functions, data type information for all XML messages, binding information about the specific protocol to be used and address information for locating the specified service.

WSDL is not tied to a specific XML messaging system, but it does include built-in extensions for describing SOAP services.

Page 33: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 33

UDDI

UDDI currently represents the discovery layer within the Web services protocol stack.

Originally created by Microsoft, IBM and ARIBA.It represents a technical specification for publishing

and finding businesses and Web servicesPrincipal categories for data:• White pages - general company specific

information• Yellow pages - general classification data eg

product code, industry code or geographic code.• Green pages - technical information about a Web

service.

Page 34: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 34

Web ServicesThe excitement over Web services is based largely on the potential for a combination of XML, the Web, the SOAP and WSDL specifications, and to-be-defined protocol stacks to address many of the problems these technologies have encountered. For example, distributed object systems such as Microsoft's COM family and the OMG CORBA standard did not interoperate, each presented numerous security and administration challenges when deployed over the internet, and neither quite meet the scalability expectations created by the Web. Various XML-based B2B systems have showed much potential, but created incompatible protocols on top of the internet standards which lead to interoperability problems. The Web has proven enormously popular, scalable, and interoperable, but it too presents many challenges -- reliability, security, database-level transactions, details of how to map platform-neutral data, URIs and HTTP operations to back-end application systems, and many others -- that must be handled by Web applications rather than some standardized infrastructure.

Quote from: W3C Web Services Architecture Document http://www.w3.org/TR/ws-arch

Page 35: Web services: an Introduction Stuart Fitz-Gerald Feb 2005

Web services - Stuart Fitz-Gerald 35

For next time:

We will consider:• Wikis, Web logs and VOIP (Dave

Martland two sessions); then from 8th March 2005,

• The mechanism role of Web Services.