Tag: Value standard cannot decompress Val depend name POS technology
, in ASP. XML WEB Service supports three protocols to communicate data with users. These three types of agreements are:
1. Soap:simple Object Access Protocol
2. Http-get
3. Http-post
1 . First, let's take a look at the approximate definition of these three.
In these three protocols, soap is the most commonly used connection protocol for XML Web service. Soap is significantly more complex than HTTP, but it has more receptive capabilities. SOAP is an XML-based protocol that provides a way to package data (packaging) and encode (Encoding) for network data transfer. Any user can communicate with any XML Web service using the SOAP protocol, even if the XML Web service is not built on the. NET platform, such as Java, and we can use SOAP for data transfer. As a result, soap is also language independent. (Language Independence)
HTTP (hypertext Transfer Protocol) is already a well-known protocol, which is the standard for XML WEB service data transfer, including when transmitting data using SOAP. HTTP compresses the SOAP message and then transmits it in the form of a network. However, when we talk about using Http-get and Http-post under XML Web service, we are actually talking about the ability to invoke the methods in XML Web service alone using HTTP, which I say alone, referring to not using soap.
In HTTP, GET and post are not a protocol, they are two of several methods that can be used to interact with Web service. However, the ability to transmit parameters and data from these two methods makes them a simple, well-suited tool for invoking XML Web service.
2 . Comparison of http-get and Http-post
The biggest difference between the two is how the data is bundled with the requested message.
The processing characteristics of Http-get are as follows:
。 To add data to a URL
。 Use a question mark ("?" ) represents the end of the URL address and the beginning of the data.
。 Each element of the data appears in the form of a name/value (Name/value).
。 Use a semicolon (";") To differentiate multiple data elements.
The processing characteristics of Http-post are as follows:
。 Include the data in the HTTP body.
。 Similarly, the elements of the data appear in the form of name/value (Name/value).
。 Each data element, however, occupies one line of the subject, respectively.
From these two different processing characteristics, you can see their differences, and you can also use IE to open a Web service file, in the page, IE will show the difference of two kinds of data.
3 . Comparison of HTTP and SOAP
Http-get and Http-post provide a simple tool for interacting with XML Web service, which has the following advantages over soap:
。 It is very easy to create the right http-get and http-post messages, and Http-get and Http-post are the best choice when facing customers who cannot use soap.
。 In response to Http-get and http-post messages, complex XML processing is not required. The response includes XML, but it has a simple framework and can easily handle the response using generic techniques. These features make http-get and http-post useful for platforms that do not support XML.
。 Http-get and http-post messages are simpler than SOAP messages. This helps to improve overall performance.
However, there must be some loss, good and bad, and they also have the shortcomings that can not be ignored:
。 You cannot use HTML to invoke a method in an XML Web service that takes a complex data type as a parameter.
。 You can call methods in the XML Web service that return a value to a complex data type, but the response will include only the name/value in each region of the complex data type, and the returned value has no structure to say. You must manually extract the data to the WSDL file.
。 In HTTP, you cannot use reference for the transfer of parameters.
。 Communicating with XML Web service using HTTP is not a agreed-to industry standard technology. Although HTTP works correctly with the XML Web service in ASP. NET Web application, it does not guarantee that it will work properly in other environments.
This is my initial understanding of the XML Web service, there are inevitably some errors. If not, please correct them.
XML Web Service First experience: Http-get, http-post and soap comparison