Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

SOAP HTTP Binding

SOAP HTTP Protocol


HTTP Protocol

HTTP communicates over TCP/IP. An HTTP client uses TCP to connect to an HTTP server. After the connection is established, the client can send an HTTP request message to the server:



POST /item HTTP/1.1

Host: 189.123.255.239

Content-Type: text/plain

Content-Length: 200

The server then processes the request and sends an HTTP response back to the client. This response contains a status code that indicates the state of the request:



200 OK

Content-Type: text/plain

Content-Length: 200

In the example above, the server returned a status code of 200. This is the standard success code for HTTP.

If the server cannot decode the request, it might return information like this:



400 Bad Request

Content-Length: 0


SOAP HTTP Binding

A SOAP method refers to an HTTP request/response that follows the SOAP encoding rules.

HTTP + XML = SOAP

A SOAP request may be an HTTP POST or an HTTP GET request.

An HTTP POST request specifies at least two HTTP headers: Content-Type and Content-Length.


Content-Type

The Content-Type header of a SOAP request and response defines the MIME type of the message, as well as the character encoding (optional) of the XML body for the request or response.

Syntax



Content-Type: MIMEType; charset=character-encoding

Example



POST /item HTTP/1.1

Content-Type: application/soap+xml; charset=utf-8


Content-Length

The Content-Length header of a SOAP request and response specifies the number of bytes in the request or response body.

Syntax



Content-Length: bytes

Example



POST /item HTTP/1.1

Content-Type: application/soap+xml; charset=utf-8

Content-Length: 250