Brief description and comparison of Web service implementation scheme (REST+SOAP+XML-RPC) (transfer)

 

Reference: http://hi.baidu.com/ripen/item/2eb66b460f632b33fa896007

 

The three mainstream Web service implementation schemes currently known are:
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: Representational State Transfer , using standard HTTP methods (GET/PUT/POST/DELETE) to abstract all Web system services into resources using Web services, REST observes the entire network from the perspective of resources, distributed in Resources everywhere are identified by URIs, and client applications use URIs to obtain representations of resources. 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 options

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

Efficiency and ease of use : REST is better

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

In general , more and more web services are designed and implemented in REST style because REST-style web services are significantly more compact compared to complex SOAP and XML-RPC . For example, Amazon.com 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 the same time, it is very important not to distort REST. Nowadays, many websites follow the trend to develop REST-style interfaces. In fact, they are all learning the shape and not knowing the heart. In the end, they become nondescript, the performance is not good, and the security cannot be guaranteed. There is only one It looks like a decent pouch.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326664983&siteId=291194637