Reputation: 2087
whats the real reason behind using soap to pass values between web-service and client application ? Why cant we use XML ? What advantages does soap give over XML?
Upvotes: 0
Views: 2141
Reputation: 188154
Soap uses XML as its message format, you can look at the example below. The advantage over plain XML messages is, that you have a spec, which defines, how you construct calls to remote services (which was a revolution many years ago). Over the years, a competing approach, namely REST has gained more traction in this space, not least because the SOAP has some shortcomings.
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 299
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
</soap:Header>
<soap:Body>
<m:GetStockPrice xmlns:m="http://www.example.org/stock">
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
Upvotes: 4