SOAP Getting St...login
SOAP Getting Started Tutorial
author:php.cn  update time:2022-04-11 14:22:12

SOAP Body element



The mandatory SOAP Body element used 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 message's final endpoint.

Direct child elements of a SOAP Body element can be namespace qualified.

Example

<?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>Apples</m:Item>
​ </m:GetPrice>
</soap:Body>

</soap:Envelope>

The above example requests the price of Apple. Note that the m:GetPrice and Item elements above are application-specific elements. They are not part of the SOAP standard.

And a SOAP response should look 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.w3schools.com/prices">
                    <m:Price>1.90</m:Price>
​ </m:GetPriceResponse>
</soap:Body>

</soap:Envelope>
##