For details about the differences between Web Service (SOAP) and HTTP interfaces, servicesoap

Source: Internet
Author: User

For details about the differences between Web Service (SOAP) and HTTP interfaces, servicesoap
What is web service?

The Simple Object Access Protocol (soap) is a special version of http post. It follows a special xml Message format and is set to Content-type: text/xml any data can be xml-based.

SOAP: Simple Object Access Protocol. Simple Object Access Protocol (SOAP) is a lightweight, simple, XML-based protocol, it is designed to exchange structured and solidified information on the WEB. SOAP can be used in combination with many existing Internet protocols and formats, including Hypertext Transfer Protocol (HTTP), Simple Mail Transfer Protocol (SMTP), and multi-purpose Internet Mail Extension protocol (MIME ). It also supports a large number of applications from the message system to Remote Process calling (RPC.

SOAP is an XML-based protocol for message exchange, which can be transmitted over HTTP. In fact, HTTP is the most common transmission tool for SOAP messages. After soap serializes the information in XML format, it then packs and transmits the information in http format. The transfer method is tcp or udp. A metaphor is easy to understand. Tcp and udp are both roads. tcp is considered as a general road, udp expressway, and soap and http are both cars, so both soap and http can run on tcp and udp. Soap can be transmitted over http. In reality, soap is a car, http is a car truck, and soap information is loaded into http before being transported, of course, the path is tcp or udp. Soap can be transmitted over the http protocol. This sentence is not accurate. It is more accurate. The first statement is that soap information can be packaged over http and transmitted over tcp or udp.

SOAP consists of four parts:

SOAP

It defines a framework that describes the content in a message, who should process it, and whether it is optional or necessary.

SOAP encoding rules: it defines a serialization mechanism for exchanging instances of the data types defined by an application.

Soap rpc: it defines a protocol used to represent remote process calls and responses.

SOAP binding: defines a protocol that uses the underlying transmission protocol to exchange SOAP encapsulation between nodes.

SOAP messages are basically unidirectional transmission from the sending end to the receiving end, but they are often combined to execute a mode similar to request/response. All SOAP messages are encoded in XML format. A soap message is an XML file that contains an essential SOAP encapsulation package, an optional SOAP header, and a required SOAP block.

Binding SOAP to HTTP provides the advantages of using SOAP styles, scattered flexibility, and HTTP's rich feature libraries. Transmitting SOAP over HTTP does not mean that SOAP will overwrite the existing HTTP semantics, but that the SOAP semantics on HTTP will naturally map to the HTTP semantics. When HTTP is used as the Protocol binding, RPC requests are mapped to HTTP requests, while RPC responses are mapped to HTTP responses. However, using SOAP on RPC is not limited to HTTP binding.

SOAP can also be bound to TCP and UDP protocols.

Why Learning web Services?

Most external interfaces implement web service methods instead of http methods. If you don't, there is no way to connect them.

Is web service more advantageous than http (post/get?

1. The methods and required parameters implemented in the interface are clear at a glance

2. Don't worry about Case sensitivity.

3. Do not worry about Chinese urlencode

4. Do not declare authentication (account, password) parameters multiple times in the code

5. Passing parameters can be arrays, objects, etc...

Is web service faster than http (post/get?

Xml parsing may reduce the speed.

Can a web service be replaced by http (post/get?

Yes, and the current open platform is implemented using HTTP (post/get.

Some sayings

Httpservice uses post and get to get what you want

Webservice is to use the soap protocol to get what you want. It can process more complex data types than httpservice.

When you want to call a content of your service, you can use HttpService instead of cross-domain issues.

If you need to call a service of another application in the background, you must use webService.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.