Webservice is the encapsulation and supplement of http-based soap protocol. If you consider public and stable interfaces, you can try your best.
Comparison and consideration of whether socket, http, and webservices are put together
It mainly depends on the perspective you are concerned about. This perspective can be either technical or user needs.
1. Data Transmission Mode
1.1 Definitions and features of socket Transmission
The so-called socket is also known as "socket", which implements physical connections between the server and the client and transmits data. It mainly includes udp and tcp Protocols. The socket is in the transmission layer of the network protocol.
Udp protocol: broadcast data transmission without data verification
Tcp: Transmission Control Protocol, a connection-oriented protocol that provides a reliable full-duplex byte stream for user processes,
Features of socket transmission:
Advantages
1) data is transmitted in bytes, which can be customized and has a small amount of data (low cost for mobile apps)
2) Short data transmission time and high performance
3) suitable for real-time information interaction between the client and the server
4) encryption, strong data security
Disadvantages:
1) The transmitted data must be parsed and converted to application-level data.
2) high requirements on the development level of developers
3) increased development compared with http Transmission
1.2 Definitions and features of http-based transmission
Currently, http-based transmission mainly involves http protocol and http-based soap protocol (web service). Common methods are http post, get request, and web service.
Http-based transmission features
Advantages:
1) convenient use of application-level interfaces
2) low requirements on programmer development and high fault tolerance
Disadvantages:
1) Slow transmission speed and large data packets (http protocol contains auxiliary application information)
2) for real-time interaction, the server performance is under heavy pressure.
3) Poor Data Transmission Security
2. Applicability of various data transmission modes
2.1 socket transmission Applicability
Features of socket-based transmission: socket transmission is suitable for applications with high transmission speed, security, real-time interaction, and costs, such as online games, mobile apps, and intra-bank interaction.
2.2 applicability of http-based transmission
Http-based transmission features: http-based transmission is suitable for transmission speed and security
Applications with low requirements and fast development are required. Such as the company's OA system and Internet services
I think it is not appropriate to compare the socket with http and webservices. The so-called http cloud is to wrap the socket once, and the latter is more underlying. However, in comparison with http and webservices