SOAP HTTP Binding
作者:w3pop.com 翻译/整理:w3pop.comThe HTTP Protocol
HTTP communicates over TCP/IP. An HTTP client connects to an HTTP server using TCP. After establishing a connection, the client can send an HTTP request message to the server:
HTTP是通过TCP/IP进行通讯的。 HTTP客户端通过TCP协议连接到HTTP服务器。在建立连接之后,客户端就可以向服务器发送HTTP请求信息了。
POST /item HTTP/1.1 |
The server then processes the request and sends an HTTP response back to the client. The response contains a status code that indicates the status of the request:
服务器会处理请求并通过HTTP来响应客户端。响应包含有指明请求者状态的状态代码。
200 OK |
In the example above, the server returned a status code of 200. This is the standard success code for HTTP.
在下面这个例子中,服务器会返回一个200的状态代码。这是HTTP的标准成功代码。
If the server could not decode the request, it could have returned something like this:
如果服务器不能破解请求代码,那它就会如下返回:
400 Bad Request |
SOAP HTTP Binding
SOAP HTTP捆绑
A SOAP method is an HTTP request/response that complies with the SOAP encoding rules.
SOAP方式是一个遵照SOAP编码规则的HTTP请求/响应。
HTTP + XML = SOAP
A SOAP request could be an HTTP POST or an HTTP GET request.
SOAP请求是HTTP POST 或 HTTP GET请求。
The HTTP POST request specifies at least two HTTP headers: Content-Type and Content-Length.
HTTP POST请求详细说明了最少2个HTTP标题(HTTP header) :Content-Type (内容类型)和 Content-Length.(内容长度)
Content-Type
内容类型
The Content-Type header for a SOAP request and response defines the MIME type for the message and the character encoding (optional) used for the XML body of the request or response.
SOAP请求和响应的内容长度标题定义了用于请求或响应的XML主要部分的信息和字符编码(可选择的)的MIME类型 。
Syntax
语法
Content-Type: MIMEType; charset=character-encoding |
Example
实例
POST /item HTTP/1.1 |
Content-Length
内容长度
The Content-Length header for a SOAP request and response specifies the number of bytes in the body of the request or response.
SOAP请求和响应的内容长度标题详细说明了请求和响应的主体部分的字节数。
Syntax
语法
Content-Length: bytes |
Example
实例
POST /item HTTP/1.1 |