Microsoft KB Archive/833383

= Differences among the HTTP-GET protocol, the HTTP-POST protocol, and the SOAP protocol for ASP.NET services =

Article ID: 833383

Article Last Modified on 2/6/2004

-

APPLIES TO


 * Microsoft Web Services Enhancements for Microsoft .NET 1.1
 * Microsoft Web Services Enhancements for Microsoft .NET 2.0

-





SUMMARY
This article discusses differences among the following protocols that are used to access Microsoft ASP.NET services:
 * Hypertext Transfer Protocol (HTTP)-GET
 * HTTP-POST
 * SOAP



The HTTP-GET protocol and the HTTP-POST protocol
These protocols encode request parameters as name-and-value pairs in the HTTP request. The HTTP-GET protocol and the HTTP-POST protocol provide backward compatibility in the following ways.
 * The HTTP-GET protocol creates a query string of the name-and-value pairs and then appends the query string to the URL of the script on the server that handles the request. Therefore, you can mark the request.
 * The HTTP-POST protocol passes the name-and-value pairs in the body of the HTTP request message.

The SOAP protocol
This protocol is an XML-based protocol that is intended to exchange structured information in a decentralized, distributed environment. Web services typically use the SOAP protocol only for communications. Communications support for the HTTP-GET protocol and for the HTTP-POST protocol is more limited than for the SOAP protocol.

Advantages of the SOAP protocol
The SOAP protocol has the following advantages when you compare the SOAP protocol to the HTTP-GET protocol and to the HTTP-POST protocol:  ==== Required SOAP headers ====

The HTTP-GET bindings and the HTTP-POST bindings cannot send and cannot receive header information. If the Web Service Description Language (WSDL) document states that a header must always be included in a message that is exchanged between the client and the server, the message must be encoded by using SOAP.  ==== Complex input parameters ====

ASP.NET does not support encoding complex types that are encoded in the name-and-value pairs in the query string (HTTP-GET) or in the body of the HTTP request (HTTP-POST). The HTTP-GET protocol and the HTTP-POST protocol support only primitive types, enumeration types, and array types of primitives and enumerations. SOAP supports more complex data types.

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

326791 INFO: Supported data types for Web services that are called through the SOAP protocol or the HTTP protocol

 ==== Return parameter ====

ASP.NET does not support encoding in-and-out parameters or out parameters in the message that is returned to the client because of an HTTP-GET request or an HTTP-POST request. Only the return parameter can be passed back to the client.  ==== Strongly-typed data ====

The data that is contained in the SOAP message is strongly-typed data. The data uses an XML Schema. Additionally, XML data types can be mapped fairly well to Microsoft .NET data types.  ==== Message exchange ====

SOAP permits message exchange over several protocols. Examples of the protocols that SOAP can use are the Simple Mail Transfer Protocol (SMTP), the Transmission Control Protocol (TCP), the File Transfer Protocol (FTP), and the HTTP protocol. HTTP-GET and HTTP-POST are limited to only the HTTP protocol.  ==== Share information ====

SOAP is the default protocol that is used to share information across applications. </ul>

Default protocols for the Microsoft .NET Framework 1.0 and for the .NET Framework 1.1
For the protocols that are permitted to communicate with a Web service, there is a difference between the .NET Framework 1.0 and the .NET Framework 1.1.

By default, you can use the SOAP protocol, the HTTP-GET protocol, or the HTTP-POST protocol to communicate with a Web service that runs on the .NET Framework 1.0. By default, you can only use the SOAP protocol to communicate with a Web service that runs on the .NET Framework 1.1.

Protocol bindings
For additional information about how you can specify the protocol bindings that your Web service supports, click the following article number to view the article in the Microsoft Knowledge Base:

815150 HOW TO: Limit the Web services protocols that a server permits

<div class="references_section">