The Body Element
  • The Body element is mandatory and contains the message payload.
  • A SOAP message can have only one Body element.
  • The Body element can contain an XML document fragment as its child element, which might be namespace-qualified.
  • The Body element can contain a Fault element.
  • The Body element must be an immediate child element of the Envelope element or follow the Header element, if the Header element is present.

In the code example, getBook is a child element of the Body element and http://www.school.com/books is the namespaceURI.

<?xml version="1.0"?>

<Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope" encodingStyle="http://www.w3.org/2001/12/soap-encoding">

  <Header>
  <m:Trans
  xmlns:m="http://www.school.com/transaction/">
  </m:Trans>
  </Header>

  <Body>
  <m:getBook
  xmlns:m="http://www.school.com/books">
  <m:Item>
  Pride and Prejudice
  </m:Item>
  </m:getBook>
  </Body>

</Envelope>

Click the Next button to continue.