SOAP HTTP Protocol
HTTP Protocol
HTTP communicates over TCP/IP. HTTP clients use TCP to connect to HTTP servers. After establishing a connection, 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 this request and sends an HTTP response back to the client. This response includes a status code indicating the request's status:
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 in HTTP.
If the server cannot decode the request, it might return a message like this:
400 Bad Request
Content-Length: 0
SOAP HTTP Binding
SOAP methods refer to HTTP requests/responses that adhere to SOAP encoding rules.
HTTP + XML = SOAP
SOAP requests can be HTTP POST or HTTP GET requests.
An HTTP POST request requires at least two HTTP headers: Content-Type and Content-Length.
Content-Type
The Content-Type header in SOAP requests and responses defines the MIME type of the message and optionally the character encoding for the XML body in 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 in SOAP requests and responses 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