SOAP Body Element
- Previous Page SOAP Header
- Next Page SOAP Fault
The mandatory SOAP Body element contains the actual SOAP message.
SOAP Body Element
The required SOAP Body element can contain the actual SOAP message intended to be delivered to the final endpoint of the message.
The direct child elements of the SOAP Body element can be a qualified namespace. SOAP defines an element within the Body element in the default namespace ("http://www.w3.org/2001/12/soap-envelope") as the Fault element of SOAP, which is used to indicate error messages.
<?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.codew3c.com/prices"> <m:Item>Apples</m:Item> </m:GetPrice> </soap:Body> </soap:Envelope>
In the above example, the price of apples is requested. Note that the m:GetPrice and Item elements in the above are application-specific elements and are not part of the SOAP standard.
A SOAP response should look something like this:
<?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.codew3c.com/prices"> <m:Price>1.90</m:Price> </m:GetPriceResponse> </soap:Body> </soap:Envelope>
- Previous Page SOAP Header
- Next Page SOAP Fault