Speak relatively simple and general, because remember too much will forget the key point, so choose some simple to do memory.

The communication protocol of a network architecture

A basic understanding

  1. These are all protocols, and each protocol has its own default port.
  2. HTTP: stateless and can only be initiated by clients.
  3. Socket: an abstract interface for the transport layer (TCP/UDP) provided by the operating system. It is a programming concept and an intermediate software abstraction layer for the communication between the application layer and the TCP/IP protocol family. It is a group of interfaces. Socket is a facade mode, which hides the complex TCP/IP protocol family behind Socket interfaces. For users, a simple set of interfaces is all. Lets the Socket organize data to conform to the specified protocol. When two hosts communicate, they must connect through sockets, namely, the application layer >Socket > transport layer.
  4. WebSocket: bidirectional communication protocol. No backtracking restriction; Similar to HTTP, a handshake is required to establish a connection. When a Websocket establishes a connection, data is transmitted through HTTP. After the connection is established, the HTTP protocol is not required for real transmission.

webservice

Question: If there are two machines a and B, how can the program of A be accessed by the host of B? Take to cross programming language, cross operating system to achieve, that is, with webService can be achieved.

Webservice is a remote call technology across programming languages and operating system platforms. On the surface, WebService is an application program that exposes an API that can be called through the Web to the outside world. On the deeper level, WebService is a new platform for establishing interoperable distributed application programs, which is a platform and a set of standards.

So, since it is a platform, how to implement the creation of distributed applications? If you think about it, any platform has its own data representation and type system. To achieve interoperability, WebServices provide a standard to describe SEB services. Ok, so with a description of how to implement a remote call, this method is a remote call protocol (RPC), and RPC must be independent of the platform programming language.

Webservice platform technology: XML+XSD, SOAP, WSDL

concept

  • SOAP = HTTP +XML data format
  • XML is the format for representing data in the WebService platform
  • XSD is designed to regulate data types in XML.
  • Simple Object Access Protocol (SOAP) is a Protocol
  • WSDL (Web Services Description Lauguage) An XML-based language used to describe Web Services and their functions, parameters, and return values.

Details When a WebService sends a request and receives a result over HTTP, the request content and result are all in XML format, and some HTTP headers are added to explain the content format of the HTTP message. These specific HTTP headers and XML content formats are SOAP. SOAP provides a standard RPC method to invoke a Web Service.

SOAP requests are a specialized version of HTTP POST that follows a special XML message format, with the Content-Type set to text/ XML.

WSDL is a standard format understood by both WebService clients and servers. The WSDL file is stored on the Web server and can be accessed through a URL address. The WebService provider can expose its WSDL file address in two ways:

  1. Register with the UDDI server so that it can be found
  2. Tell the client caller directly