SOAP BodyElement
Das erforderliche SOAP-Body-Element enthält die eigentliche SOAP-Nachricht.
SOAP-Body-Element
Das erforderliche SOAP-Body-Element kann die eigentliche SOAP-Nachricht enthalten, die für den endgültigen Endpunkt der Nachricht bestimmt ist.
Direkte untergeordnete Elemente des SOAP-Body-Elements können qualifizierte Namespaces sein.
Beispiel
<?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>
<m:GetPrice xmlns:m="http://www.w3schools.com/prices">
<m:Item>Äpfel</m:Item>
</m:GetPrice>
</soap:Body>
</soap:Envelope>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
<m:GetPrice xmlns:m="http://www.w3schools.com/prices">
<m:Item>Äpfel</m:Item>
</m:GetPrice>
</soap:Body>
</soap:Envelope>
Das obige Beispiel fragt den Preis für Äpfel ab. Beachten Sie, dass die Elemente m:GetPrice und Item oben anwendungsspezifische Elemente sind. Sie sind nicht Teil des SOAP-Standards.
Eine SOAP-Antwort sollte ungefähr so aussehen:
<?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>
<m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
<m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>