Download presentation
Presentation is loading. Please wait.
1
12.3 Communication Siddharth Shekhar
2
Agenda Introduction HTTP HTTP Connections HTTP Methods HTTP Messages
SOAP (Simple Object Access Protocol) Latest and New Techniques Future Research References Agenda
3
Introduction Web-based distributed systems, there are only a few communication protocols that are used. For traditional Web systems, HTTP is the standard protocol for exchanging messages. For web services, SOAP is the default way for message exchange.
4
HTTP Communication in the web between clients and server is based on HTTP HTTP is a relatively simple client-server protocol: a client sends a request message to a server and waits for a response message. HTTP is stateless No open connection Server does not maintain information of clients
5
HTTP Connections HTTP is based on TCP.
Whenever a client issues a request to a server, it first sets up a TCP connection to the server and then sends its request message on that connection. The same connection is used for receiving the response. By using TCP as its underlying protocol, HTTP need not be concerned about lost requests and responses. One of the problems with the first versions of HTTP was its inefficient use of TCP connections. HTTP 1.0 vs. HTTP 1.1
6
HTTP Connections In HTTP version 1.0 and older, each request to a server required setting up a separate connection. When server had responded the connection was broken down. These connections are referred as non-persistent. In HTTP version 1.1, several requests and their responses can be issued without the need for a separate connection. These connections are referred as persistent. A client can issue several requests in a row without waiting for the response to the first request which is referred as pipelining.
7
HTTP Connections
8
HTTP Methods
9
All communication between a client and server takes place through messages.
1 HTTP recognizes only request and response messages. 2 HTTP Messages
10
HTTP MESSAGES (Request)
11
Message Delimiters
12
HTTP MESSAGES (Response)
Status code (Phrase): 200 (OK), 400 (Bad Request), 403 (Forbidden), and 404 (Not Found).
13
Simple Object Access Protocol
Simple Object Access Protocol (SOAP) forms the standard for communication with Web services. SOAP has made HTTP even more important than it already was: Its main purpose is to provide a relatively simple means to let different parties who may know very little of each other be able to communicate. In other words , the protocol is designed with the assumption that two communicating parties have very little common knowledge.
14
SOAP messages are largely based on XML
SOAP messages are largely based on XML. XML is a meta-markup language, meaning that an XML description includes the definition of the elements. The definition of the syntax is used for a message is part of that message. Providing this syntax allows a receiver to parse very different types of messages. The meaning of a message is still left undefined, and thus also what actions to take when a message comes in. If the receiver cannot make any sense out of the contents of a message no progress can be made. SOAP-XML
15
SOAP request POST /InStock HTTP/1.1 Host: Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap=" soap:encodingStyle=" <soap:Body xmlns:m=" <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>
16
SOAP response HTTP/ OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap=" soap:encodingStyle=" <soap:Body xmlns:m=" <m:GetStockPriceResponse> <m:Price>34.5</m:Price> </m:GetStockPriceResponse> </soap:Body> </soap:Envelope>
17
SOAP-INTERACTIONS Conversational exchange style . In this style, two parties essentially exchange structured documents. For example, such a document may contain a complete purchase order as one would fill in when electronically booking a flight. The response to such an order could be a confirmation document, now containing an order number, flight information. A seat reservation, and perhaps also a bar code that needs to be scanned when boarding .
18
Performance RPC (Remote procedure call)-style exchange is supported by a binding to HTTP, whereas a conversational style message will be bound to either SMTP or HTTP. However, in practice, most SOAP messages are sent over HTTP. Although XML makes it much easier to use a general parser because syntax definitions are now part of a message, the XML syntax itself is extremely verbose. As a result, parsing XML messages in practice often introduces a serious performance bottleneck. Discovering what this SOAP message conveys requires some searching.
19
Latest Techniques: Representational State Transfer (REST)
Representational State Transfer (REST) is a style of architecture based on a set of principles that describe how networked resources are defined and addressed. REST is an alternative to SOAP and JavaScript Object Notation (JSON). RESTful applications use HTTP requests to post data (create and/or update), read data (e.g., make queries), and delete data. Thus, REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operations. Much like Web Services, a REST service is: Platform-independent (you don't care if the server is Unix, the client is a Mac, or anything else), Language-independent (C# can talk to Java, etc.), Standards-based (runs on top of HTTP), and Can easily be used in the presence of firewalls.
20
How Simple is REST Example Graph in Facebook www.facebook.com/youtube
EoyDlxZCX9FGtrvtHZAA5z46H2ZBMJSaJ9IMS95psMiv5MJwTjBgGsGFPht97n8RPukkrG Oe9J7OGGEOvQsZBzAen4cEFqnTKqep47zRZCyOnkwiuhoZAqV4UPjFlAYYG4ZBh2Lhm vqtxPFV8uNWtmL2xVcQShD8iUOTzZCo2KY8zEVtAzBves0gZDZD uEoyDlxZCX9FGtrvtHZAA5z46H2ZBMJSaJ9IMS95psMiv5MJwTjBgGsGFPht97n8RPukkr GOe9J7OGGEOvQsZBzAen4cEFqnTKqep47zRZCyOnkwiuhoZAqV4UPjFlAYYG4ZBh2Lh mvqtxPFV8uNWtmL2xVcQShD8iUOTzZCo2KY8zEVtAzBves0gZDZD&fields=id,name,li kes
21
Future: IPFS is the Distributed Web
A peer-to-peer hypermedia protocol to make the web faster, safer, and more open. Each file and all of the blocks within it are given a unique fingerprint called a cryptographic hash. IPFS removes duplications across the network and tracks version history for every file. Each network node stores only content it is interested in, and some indexing information that helps figure out who is storing what. When looking up files, you're asking the network to find nodes storing the content behind a unique hash. Every file can be found by human-readable names using a decentralized naming system called IPNS.
22
Example $ ipfs daemon And add the directory containing your website:
$ ls mysite img index.html $ ipfs add -r mysite added QmcMN2wqoun88SVF5own7D5LUpnHwDA6ALZnVdFXhnYhAs mysite/img/spacecat.jpg added QmS8tC5NJqajBB5qFhcA1auav14iHMnoMZJWfmr4k3EY6w mysite/img added QmYh6HbZhHABQXrkQZ4aRRSoSa6bb9vaKoHeumWex6HRsT mysite/index.html added QmYeAiiK1UfB8MGLRefok1N7vBTyX8hGPuMXZ4Xq1DPyt7 mysite/
23
Future: Mercury Protocol
The Future of Communication Platforms Built on the Ethereum Blockchain Decentralized: Not owned or controlled by any one party More Secure : All data is tamper resistant and secured by the blockchain Trustless: Verify messages and transactions without a trusted third party Application Agnostic: Generalized protocol for all communication types
24
References Hirsch, Frederick; Kemp, John; Ilkka, Jani ( ). Mobile Web Services: Architecture and Implementation. John Wiley & Sons (published 2007). p. 27. ISBN Retrieved Simple Object Access Protocol (SOAP) defines a messaging envelope structure designed to carry application payload in one portion of the envelope (the message body) and control information in another (the message header). "Web Services Addressing (WS-Addressing)". Retrieved "Web Services Architecture". World Wide Web Consortium. 11 February Relationship to the World Wide Web and REST Architectures. Retrieved 29 September 2016. Fielding, Roy Thomas (2000). "Chapter 5: Representational State Transfer (REST)". Architectural Styles and the Design of Network-based Software Architectures (Ph.D.). University of California, Irvine. This chapter introduced the Representational State Transfer (REST) architectural style for distributed hypermedia systems. REST provides a set of architectural constraints that, when applied as a whole, emphasizes scalability of component interactions, generality of interfaces, independent deployment of components, and intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems.
25
Thank You
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.