SOAP API
What is SOAP?
1. An Envelope element that identifies the XML document as a SOAP message
- Containing part
- Used encapsulate all the details
- Root element
2. A Header element that contains header information
- authentication credentials which can be used calling application.
- Contain the definition of complex types
- Contain parameters simple types such as string and numbers, but can also be complex object type.
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
</soap:Header>
<soap:Body>
<m:GetUser>
<m:UserId>123
</m:UserId>
</m:GetUser>
</soap:Body>
</soap:Envelope>
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<m:GetUserResponse>
<m:Username>Tony Stark
</m:Username>
</m:GetUserResponse>
</soap:Body>
</soap:Envelope>
Code – identifying the fault
String – A human readable explanation of the fault
Actor – Information about who caused the fault to happen
Detail – Appication specific error information related to the Body elemet