Ein SOAP-Aufruf besteht aus einer Anfrage und einer Antwort. Die Antwort ist entweder das Ergebnis der Anfrage oder eine Fehlermeldung.
Hier die Anfragen des Demoprogramms ,, Fortune.java`` aus dem Apache-Soap Paket. Dieses Programm greift auf ein Beispiel Web-Service der Firma Lemurlabs zu um ein ,,fortune cookie`` zu holen.
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getAnyFortune xmlns:ns1="urn:lemurlabs-Fortune"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
</ns1:getAnyFortune>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>