Three mainstream Web service implementation solutions: (welcome to make bricks and add)

REST: Representational state transition (software architectural style)
SOAP: Simple Object Access Protocol
XML-RPC: Remote Procedure Call Protocol

The following is a brief introduction:

REST: Representation State transfer (Representational State Transfer), using Web services to use standard HTTP methods (GET/PUT/POST/DELETE) to abstract all Web system services into resources, REST observes the entire network from the perspective of resources, distributed in various places. The resource is identified by the URI, and the client's application obtains the representation of the resource through the URI. The get, post, put and delete abstracted by the Http protocol are like the most basic additions, deletions, changes and searches in the database, and various resources on the Internet are like the records in the database (it may not be a good analogy). In the end, operations can always be abstracted into these four basic operations. After defining the rules for locating resources, operations on resources can be implemented through the standard Http protocol, and developers will also benefit from this lightweight protocol. REST is a software architecture style rather than a protocol or a specification. It is a development method for network applications, which can reduce the complexity of development and improve the scalability of the system.

SOAP: Simple Object Access Protocol (Simple Object Access Protocol) is a standardized communication specification, mainly used in Web services (web services). A simple example is used to illustrate the use of SOAP. A SOAP message can be sent to a Web site with Web Service functionality, such as a database containing housing price information. The parameters of the message indicate that this is a query message, and the site will return An XML-formatted message containing the query results (price, location, features, or other information). Because the data is delivered in a standardized, analyzable structure, it can be directly exploited by third-party sites.

XML-RPC: A distributed computing protocol for remote procedure call (RPC), which encapsulates the calling function through XML and uses the HTTP protocol as the transmission mechanism. Later, with the introduction of new functions, the standard slowly evolved into today's SOAP protocol. The XML-RPC protocol is a registered patent item. XML-RPC works by making HTTP requests to servers that have this protocol installed. The client that sends the request is generally the software that needs to make a call to the remote system.

A simple comparison of the three solutions

XML-RPC has been slowly replaced by SOAP, and it is rarely used now, but it is still copyrighted, and I will not introduce it here
Maturity : SOAP is better than REST in maturity

Efficiency and ease of use: REST is better

Security : SOAP is more secure than REST, because REST is more concerned with efficiency and performance issues

Overall, because of the REST pattern of web services compared to complex SOAP and XML-RPC In terms of significantly more concise, more and more web services are beginning to be designed and implemented in a REST style. For example, provides a near-REST-style Web service for book search; Yahoo provides a REST-style Web service. REST is very suitable for resource-based service interfaces, and is especially suitable for scenarios that require high efficiency but low security requirements. The maturity of SOAP can bring convenience to the interface design that needs to be provided to multiple development languages ​​and has higher security requirements. So I don't think it makes any sense to say that the design pattern will dominate. The key is to look at the application scenario. It is the old saying: the right one is the best.

At it is very important not to distort REST. Now many websites are following the trend. To develop a REST-style interface, in fact, you are learning its shape and not knowing its heart. In the end, it becomes nondescript, the performance is not good, and the safety is not guaranteed. There is only a seemingly decent skin.

Guess you like