Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Services Introduction

Similar presentations


Presentation on theme: "Web Services Introduction"— Presentation transcript:

1 Web Services Introduction
ITCS 4010 Grid Computing, 2005, UNC-Charlotte, B. Wilkinson, slides 3a version 0.1.

2 Distributed Computing Concepts
Web services build upon earlier distributed computing concepts One of the underlying concepts is the client-server model.

3 Client-server model Server Client Request service Database
Server response

4 Remote Procedure Call Early distributed computing system introduced in the 1980’s. Allows a local program to execute a procedure on a remote computer and get back results from the procedure. Basis of certain remote operations such as mounting remote files in a shared file system.

5 Fundamental factors of RPC
We need to know how and where to make the call. The basic RPC requires the calling program to know details about how to make the call (meaning and types augments and return value) The calling program also needs to know where to send the request.

6 Service registry RPC introduced the concept a service registry a third party used to identify location of “service” (procedure). Using a service registry is now part of what is now called a Service-Oriented Architecture.

7 Service-Oriented Architecture.
Service registry Find Publish Bind Client Server (Service requester) (Service provider)

8 Later systems Examples
Later forms of remote procedure calls in 1990’s introduced distributed objects: Examples CORBA (Common Request Broker Architecture) Java RMI (Remote Method Invocation)

9 Some aspects for a new system
Universally agreed standardized interfaces Inter-operability The need to provide flexibility Using the Internet as the network communication (Internet standards)

10 Web Services Introduced in the 2000.
Software components designed to provide specific operations (“services”) accessible using standard Internet technologies and standardized protocols. The specific standards and protocols will be described shortly. For machine interaction over a network.

11 Stateless Web Service It is generally thought that web services should be stateless – they do not remember or store information themselves from one invocation to the next. Any state information needed by the web service to complete a client request or maintained should be held separately.

12 First attempt as a stateful service
A now defunct attempt at providing a stateful service was embodied in the OGSI standard which was part of the OGSA grid computing standard Introduced in 2002(?) Abandoned in 2004 Will look at this way briefly later.

13 Web Service with state Example
Web services can be front-ends to stateful resources. Example Business application might access an inventory of items being held through a web service. Web service Database request data request data return data

14 Stateless web service + stateful resource
Concept formalized in a standard called WS-RF framework. WS-RF also at the center of recent grid computing software (Globus 4.0). Provides a way of identifying resource through the web service, and other things such as resource lifetime

15 Web Service addressing
Usually located by a URI. Example This URL is only supposed to be accessed by a computer program.

16 Web service could be located on a computer anywhere on the Internet.
Application Web Services User might interact with an application that accesses the web service to perform a function.

17 Note The term “Web Service” is a little misleading as the web service need not be on the web. It could be on the same computer as the client, or another computer in a local cluster.

18 WS-Addressing WS-Resource Framework introduced a standard for addressing WS-Resources, called WS-Addressing Introduces an End-Point Reference (EPR) to point to the service, which will provide the URL and possibly additional information about the service.

19 Service-Oriented Architecture
Client needs to: Identify location of the required service Know how to communicate with the service to get it to provide the actions required. Uses service registry - a third party.

20 Service-Oriented Architecture
Service registry 1. Publish 2. Find 3. Bind Service requester Service provider

21 Service-Oriented Architecture
Steps: Services “published” in a Service registry. Service requestor asks Service Registry to locate service. Service requestor “binds” with service provider to invoke service.

22 Key aspects Has similarities with RMI and other distributed object technologies (CORBA etc.) but: Web Services are platform independent They use XML within a SOAP message). Most use HTTP to transmit message.

23 XML-based Web Services
XML provides a flexible basis for storing and retrieving service information on web services.

24 Structure of an XML document
Optional Prolog Root Element

25 Uses symbol sequence: <? … ?>
Prolog Includes: Processing instruction to specify how to process document.. Uses symbol sequence: <? … ?> Meta-information about document, and comments.

26 <!-- this is a comment -->
One PI identifies document as a XML document, e.g. <?xml version=“1.0” encoding=“UTF-8”?> Comments, same form as HTML: <!-- this is a comment -->

27 Root element Root element contains contents of document.
Other elements are within root element and can be nested.

28 XML Tags Not predefined as in HTML.
Must define your own tags using names as names in a programming languages As in programming languages, restrictions. Case sensitive. Start with a letter. “Elements” have start and end tags. Start tags can have attributes as in HTML.

29 Namespace Mechanism If XML documents combined, can be problem if different documents use the same tag names to mean different things. With namespace mechanism, tags given additional namespace identifier to qualify it.

30 namespace identifier + local name
Qualifying names Qualified name given by namespace identifier and name used in document: Qualified name = namespace identifier + local name

31 Namespace identifier Uses URI’s (Uniform Resource Identifiers) - web naming mechanism. URLs are a subset of URI, and would typically be used, e.g.:

32 Associating namespace identifier with local name
Names in document given a prefix, i.e.: <mypo:street> Namespace identifier associated with prefix in root element:: xmlns:mypo=“

33 Namespace Example prefix
<mypo:po xmlns:mypo=“ <mypo:description> Computer, Pentium IV, 4.7 Ghz, 4 Gbytes main memory </mypo:description> </mypo:po>

34 Can apply namespace to every tag without a prefix automatically if that is required:
<mypo:po xmlns=“ <description> Computer, Pentium IV, 4.7 Ghz, 4 Gbytes main memory </description> </mypo:po>

35 Defining Legal XML Tags
Legal tags in a document defined optionally using either: Document type definitions (DTD) within document using <!DOCTYPE …. > (old, not allowed with SOAP) or XML schema

36 XML Schema Flexible way of handing legal element names. Expressed in XML. Schema is an XML document with required definitions. Handles namespaces. Has notation of data types

37 The name space given by the xmlns tag becomes the default namespace unless overridden by a prefix.

38 XML Schema Structure Example
<?xml version=“1.0” encoding=“UTF-8”?> <myRootElement xmlns= myMathService> <operation> </operation> </myRootElement> Here all tags without prefixes have the namespace given

39 XML Schema Structure Example
<?xml version=“1.0” encoding=“UTF-8”?> <myRootElement xmlns:math= myMathService> <math:operation> </math:operation> </myRootElement> Here the tag operation is qualified with the prefix math that identifies the namespace

40 Schema One could arrange that all those processing the document are preconfigured to use a specific schema or, better The scheme could be specified in the document

41 Associating a Schema with an instance of an XML document
XML schema Document xlns:xsi=“ xsi:schemaLocation=“ .. “

42 Schema validation The schema approach allows documents that are supposed to conform to XML syntax and a specific schema to be checked against the scheme, prior to processing. Formally two aspects Well-formedness – document conforms to rules of XML syntax. Validity – checks the structure and identity of elements etc. that the document should have from that schema.

43 XML “scheme definition languages” (XSD)
Each XML document conforms to its own schema that defines the tags. This gives an infinite number of XML “languages.” Many XML languages invented for specific purpose. All one needs is the language schema to use it.

44 Web Service Description
Need a way of formally describing a service, what is does, how it is accessed, etc. An Interface Description language (IDL)

45 Web Service Definition Language (WSDL)
A W3C standard XML document that describes three fundamental properties of a service: What it is - operations (methods) it provides. How it is accessed - data format, protocols. Where it is located - protocol specific network address.

46 Parts of a web services WSDL document
Root definitions and namespaces Abstract definition of service Message definitions Binding definitions to network protocols (parameters in method signature) Service definitions (where service is, ports) Type definitions - data types

47 From http://www.globus.org
Web Services 1 3 2 4 5 6 From

48 UDDI Registries Web service registries can be based upon UDDI registries (Universal Description Discovery, and Integration), introduced in 2001. UDDI specification standardized by OASIS (Organization for the Advancement of Structured Information Standards) See:

49 Notes The UDDI registry is a web service itself.
The (UDDI) registry itself has to be known to both the client and service. Registry technically unnecessary if the client already knows about the service, but usually some form of service registration and locator is present.

50 Steps to access a web service in a Service-Oriented Architecture
Client (Service requester) Server (Service provider) UDDI Service registry Publish Find WSDL Service definition UDDI Service definition Location of service Give me your WSDL WSDL Request service operation Result

51 Question Could the WDSL document be provided by the registry, and if so, is that better? Answer

52 Message exchanges Done with specific protocols.

53 Web Service Protocols Usually using a HTTP transport protocol which carries SOAP (Simple Object Access Protocol) messages holding XML documents. SOAP message HTTP envelop XML document

54 Web Services “Stack” HTTP transport
SOAP message carrying XML documents WSDL (Web Services Description Language used to describe message syntax for invoking a service and its response. UDDI (Universal Description, Discovery and Integration) used as web service discovery mechanism.

55 Web Services Stack Activity Protocol/language UDDI WSDL SOAP + XML
Service discovery UDDI WSDL Service description Service invocation SOAP + XML Service message transport HTTP

56 Simple Object Access Protocol (SOAP)
A communication protocol for passing XML documents.

57 W3C specification describes SOAP as:
“SOAP is a lightweight protocol for exchange of information in a decentralized, distributed environment. It is an XML based protocol that consists of three parts: an envelope that defines a framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined datatypes, and a convention for representing remote procedure calls and responses.”

58 Simple Object Access Protocol (SOAP)
Provides mechanisms for: Defining communication unit - a SOAP message Error handling Extensions Data representation Remote Procedure Calls (RPC’s) Document-centric approach for business transactions Binding to HTTP

59 SOAP Envelope namespace <SOAP-ENV:Envelope
xmlns=“ <SOAP-ENV:header> . </SOAP-ENV:Header> <SOAP-ENV:Body> </SOAP-ENV:Body> </SOAP-ENV:Envelope> namespace

60 What goes down the Wire HTTP packet containing:
Stuff about context, transactions, routing, reliability, security SOAP message Attachments XML/SOAP standardization body, World Wide Web Consortium (W3C) covers SOAP and attachments.

61 by S. Graham et al, SAMS publishing, 2004
Books Several books on XML, e.g.: “Building Web Services with Java: Making sense of XML, SOAP, WSDL, and UDDI, 2nd edition” by S. Graham et al, SAMS publishing, 2004 Very good but 792 pages!!

62 Additional SOAP materials
See:

63 Additional XML materials On-line materials
W3C consortium home page: W3Schools XML Tutorial :

64 Quiz What is SOAP? (a) Something you use to clean yourself
(b) A protocol for passing XML documents (c) A protocol for passing object-oriented programs (d) None of the other answers

65 What is an XML schema? (a) A way to make XML documents secure
(b) A way of defining XML tags (c) A way of encoding data for transmission (d) None of the other answers

66 What can UDDI be used for?
(a) To transmit data between computers (b) As a universal data description interface (c) As a web services registry (d) To encode the characters of the world

67 What is a WSDL document? (a) One that describes how to access a service and use it (b) One that describes the data of a service (c) One that describes how to use the client code (d) None of the other answers


Download ppt "Web Services Introduction"

Similar presentations


Ads by Google