Presentation is loading. Please wait.

Presentation is loading. Please wait.

WEB SERVICES From Chapter 19, Distributed Systems

Similar presentations


Presentation on theme: "WEB SERVICES From Chapter 19, Distributed Systems"— Presentation transcript:

1 WEB SERVICES From Chapter 19, Distributed Systems
Concepts and Design, 4th Edition by G. Coulouris, Dollimore, T. Kindberg Publisher: Addision Weseley Pub Date: 2005

2 Topics Introduction Web Services SOAP (Simple Object Access Protocol)

3 Introduction A web service provides a service interface enabling clients to interact with servers in a more general way than web browsers do. Clients access the operations in the interface of a web service by means of requests and replies formatted in XML and usually transmitted over HTTP.

4 Introduction Users require a secure means for creating, storing and modifying documents and exchanging them over the Internet. The secure channels of TLS do not provide all of the necessary requirements. XML security is intended to breach this gap.

5 Introduction Web services provide an infrastructure for maintaining a richer and more structured form of interoperability between clients and servers. They provide a basis whereby a client program in one organization may interact with a server in another organization without human supervision.

6 Introduction External data representation and marshalling of messages exchanged between clients and web services is done in XML.

7 Introduction The SOAP (Simple Object Access Protocol) specifies the rules for using XML to package messages, for example to support a request-reply protocol. Figure 1 summarizes the main points about the communication architecture in which web services operate.

8 Introduction Figure 1. Web services infrastructure and components

9 Introduction A web service is identified by a URL and can be accessed by clients using messages formatted in XML.

10 Introduction SOAP is used to encapsulate these messages and transmit them over HTTP or another protocol, for example, TCP or SMTP. A web service generally provides a service description, which includes an interface definition and other information, such as the server's URL.

11 Web Services A web service interface generally consists of a collection of operations that can be used by a client over the Internet. The operations in a web service may be provided by a variety of different resources, for example, programs, objects, databases. A web service may either be managed by a web server along with web pages; or it may be a totally separate service.

12 Web Services Many well-known commercial web services including Amazon, Yahoo, Google and eBay offer web service interfaces that allow client to manipulate their web resources. As an example, the web service offered by Amazon.com provides operations to allow clients to get information about products, to add an item to a shopping cart or to check the status of a transaction.

13 Web Services The Amazon web services may be accessed either by SOAP or by REST (REpresentaional State Transfer). The provision of a service interface allows its operations to be combined with those of other services to provide new functionality. Figure 2.

14 Web Services Figure 2. The ‘travel agent service’ combines other web services

15 Web Services A major task of many middleware platforms is to protect the programmer from the details of data representation and marshalling and sometimes with making remote invocations look like local ones. These things are provided as a part of an infrastructure or middleware platform for web services.

16 Web Services At the simplest level, clients and servers may read and write their messages directly in SOAP, using XML.

17 SOAP (Simple Object Access Protocol)
SOAP is defined to enable both client-server and asynchronous interaction over the Internet. It defines a scheme for using XML to represent the contents of request and reply messages as well as a scheme for the communication of documents. Originally, SOAP was based on HTTP, but the current version is designed to use a variety of transport protocols including SMTP, TCP or UDP.

18 SOAP (Simple Object Access Protocol)
The SOAP specification states: How XML is to be used to represent the contents of individual messages. How a pair of single messages can be combined to produce a request-reply pattern. The rules as to how the recipients of messages should process the XML elements that they contain. How HTTP and SMTP should be used to communicate SOAP messages.

19 SOAP (Simple Object Access Protocol)
A SOAP message is carried in an “envelope”. Inside the envelope there is an optional header and a body as shown in Figure 3.

20 SOAP (Simple Object Access Protocol)
Figure 3. SOAP message in an envelope

21 SOAP (Simple Object Access Protocol)
Message headers can be used for establishing the necessary context for a service or for keeping a log or audit of operations. The message body carries an XML document for a particular web service.

22 SOAP (Simple Object Access Protocol)
The XML elements envelope, header and body, together with other attributes and elements of SOAP messages are defined as a scheme in the SOAP XML namespace. Figure 4 shows an example of a simple request message without a header.

23 SOAP (Simple Object Access Protocol)
Figure 4. Example of a simple request without headers

24 SOAP (Simple Object Access Protocol)
Figure 5 shows the corresponding successful reply messages, which contains the two output arguments.

25 SOAP (Simple Object Access Protocol)
Figure 5. Example of a reply corresponding to the request in Figure 4

26 SOAP (Simple Object Access Protocol)
A transport protocol is required to send a SOAP message to its destination. SOAP messages are independent of the type of transport used- their envelopes contain no reference to the destination address.

27 SOAP (Simple Object Access Protocol)
Figure 6 illustrates how the HTTP POST method is used to transmit a SOAP message.

28 SOAP (Simple Object Access Protocol)
Figure 6. Use of HTTP POST Request in SOAP client-server communication

29 SOAP (Simple Object Access Protocol)
The HTTP headers and body are used as follows: The HTTP headers specify the endpoint address (the URI of the ultimate receiver) and the action to be carried out. The HTTP body carries the SOAP message. As HTTP is a synchronous protocol, it is used to return a reply containing the SOAP reply, as shown in Figure 5.


Download ppt "WEB SERVICES From Chapter 19, Distributed Systems"

Similar presentations


Ads by Google