当前位置: 首页 > 网络学院 > XML相关教程 > SOAP > SOAP HTTP Binding

SOAP
SOAP 介绍
SOAP 语法
SOAP Envelope
SOAP Header
SOAP Body
SOAP Fault
SOAP HTTP Binding
SOAP 实例
SOAP 总结

SOAP HTTP Binding


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 711 ::
收藏到网摘: n/a

The HTTP Protocol
HTTP 协议

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
Host: 189.123.345.239
Content-Type: text/plain
Content-Length: 200

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
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.
在上面的例子中,服务器返回了一个 200 的状态代码。这是 HTTP 的标准成功代码。

If the server could not decode the request, it could have returned something like this:
假如服务器无法对请求进行解码,它可能会返回类似这样的信息:

400 Bad Request
Content-Length: 0

 


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 请求规定至少两个 HTTP 头: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 的请求和响应的 Content-Type 头可定义消息的 MIME 类型,以及用于请求或响应的 XML 主体的字符编码(可选)。

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 for a SOAP request and response specifies the number of bytes in the body of the request or response.
SOAP 的请求和响应的 Content-Length 头规定请求或响应主体的字节数。

Syntax
语法

Content-Length: bytes

Example
实例

POST /item HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 250

评论 (0) All

登陆 | 还没注册?