SOAP HTTP绑定
生活随笔
收集整理的這篇文章主要介紹了
SOAP HTTP绑定
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
? HTTP協議
? ?HTTP在TCP/IP之上進行通信。HTTP客戶機使用TCP連接到HTTP服務器。在建立連接之后,客戶機可向服務器發送HTTP請求消息:
? ?SOAP HTTP Binding
?soap方法指的是遵守SOAP編碼規則的HTTP請求/響應。
? ?HTTP+XML=SOAP
? SOAP請求可能是HTTP POST或HTTP GET
? HTTP Post請求規定至少兩個HTTP頭:Content-Type和Content-Length。
? Content-Type
? ?SOAP的請求和響應的Content-Type頭可定義消息的MIME類型,以及用于請求或響應的XML主體的字符編碼
? ?Content-Type:MIMEType;charset=character-encoding
POST /item HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8 ? Content-Length
SOAP的
POST /item HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8 Content-Length: 250 請求和響應的Content-Length頭規定請求或響應的主體的字節數
一個 SOAP 實例
在下面的例子中,一個 GetStockPrice 請求被發送到了服務器。此請求有一個 StockName 參數,而在響應中則會返回一個 Price 參數。此功能的命名空間被定義在此地址中: "http://www.example.org/stock"
SOAP 請求:
POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"><soap:Body xmlns:m="http://www.example.org/stock"><m:GetStockPrice><m:StockName>IBM</m:StockName></m:GetStockPrice></soap:Body></soap:Envelope>SOAP 響應:
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"><soap:Body xmlns:m="http://www.example.org/stock"><m:GetStockPriceResponse><m:Price>34.5</m:Price></m:GetStockPriceResponse></soap:Body></soap:Envelope>
? ??
總結
以上是生活随笔為你收集整理的SOAP HTTP绑定的全部內容,希望文章能夠幫你解決所遇到的問題。