简单的说,soap是web应用之间进行信息传输的一种基于XML的信息格式,,一条soap消息就是一个XML文本,而且这个XML文本有基本的格式规定。
soap消息格式
<SOAP-ENV:Envelope [属性] >
<SOAP:HEADER>
...
</SOAP:HEADER>
<SOAP:Body>
</SOAP:Body>
</SOAP-ENV:Envelope>
举个例子
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nLength
<?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>