SOAP (Simple Object Access Protocol) est un protocole RPC, orienté objet, bâti sur XML.
Il permet l’invocation de méthode sur des objets distants grâce à l’échange de message XML.
SOAP n'est plus un acronyme depuis la version 1.2 qui a été réécrite en termes d'infosets XML, et non plus sous forme de sérialisations de document XML. La notion d'objet (spécifiée dans Simple OBJECT Access Protocol) devient donc obsolète.
Bien que le protocole de transport le plus commun soit http(s), il est possible de l’utiliser sur SMTP, voire tout MOM.
POST /Orders HTTP/1.1
Host: xxx.xxx.xxx.xxx
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
SOAPAction: "http://www.someorders.com/GetOrders"
<?xml version=“1.0”?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<orders:GetOrders
xmlns:orders="http://www.someorders.com/orders">
<CustomerID>ALFKI</CustomerID>
<SalesRepID>85</SalesRepID>
</orders:GetOrders>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
HTTP/1.1 200 OK
MessageType: CallResponse
Content-Type: text/xml
<?xml version=“1.0”?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<orders:GetOrdersResponse xmlns:orders="http://www.someorders.com/orders">
<data />
</orders:GetOrdersResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<SOAP-ENV:Header>
<t:Transaction xmlns:t="some-URI" SOAP-ENV:mustUnderstand="0">
5
</t:Transaction>
</SOAP-ENV:Header>