SCDJWS Study Guide: SOAP
The Body element contains the payload of the message, that is, the part intended for the final recipient of the SOAP message. The Body element is encoded as an immediate child element of the SOAP Envelope XML element. If there is no Header element, then the Body element is the first immediate child of the Envelope element. If a Header element is present in the message, then the Body element MUST immediately follow the Header element.
targetNamespace="http://schemas.xmlsoap.org/soap/envelope/"> .... <xs:complexType name="Body">
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
<xs:anyAttribute namespace="##any" processContents="lax">
Prose in the spec does not specify that attributes are allowed on the Body element </xs:documentation>
The Body element can have one or more namespace-qualified immediate child elements that are not in the http://schemas.xmlsoap.org/soap/envelope/ namespace or, if a fault occurred, a Fault element in the http://schemas.xmlsoap.org/soap/envelope/ namespace.
All immediate child elements of the Body element are called body entries and each body entry is encoded as an independent element within the Body element. A body entry is identified by its fully qualified element name, which consists of the namespace URI and the local name. Immediate child elements of the SOAP Body element MAY be namespace-qualified. SOAP defines one body entry, which is the Fault entry used for reporting errors.
The encoding rules for body entries are as follows:
- A body entry is identified
by its fully qualified element name, which consists of the namespace
the local name. Immediate child elements of the SOAP Body
element MAY be namespace-qualified.
BP 1.0 requires all immediate children of Body element be namespace
- The SOAP encodingStyle attribute MAY be used to indicate the encoding style used for the body entries (this attribute MAY appear on any element, and is scoped to that element's contents and all child elements not themselves containing such an attribute, much as an XML namespace declaration is scoped).