Skip to main content

Search 412 pages — tools, formats, elements, namespaces, directory, comparisons, XPath, datatypes, glossary, parse errors, schema errors, use cases, guides, blog and product.

SOAP envelope

<env:Body>

The required SOAP container for an application payload or a single Fault response.

Body is the message part delivered to the ultimate receiver. Normal payload children come from an application vocabulary rather than the SOAP namespace.

When processing fails, Body contains Fault instead of a successful response payload. SOAP 1.2 permits only one Fault child.

What it contains

Cardinality and constraints

Exactly one, as the final child of Envelope.

  • Must be present even when the payload is empty.
  • A Fault replaces rather than accompanies a successful payload.

What our validator does

The XML validator checks well-formedness and selected SOAP or XML Schema vocabulary rules. It reports this content-model defect with a concrete repair while staying silent on rules it cannot establish from one document.

Broken and fixed

Both documents below are well-formed XML — that is the point of this corpus — and both are run through the validator on every test run. The verdicts here are what it returned, not what we expect it to.

broken
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  <env:Body><m:getPrice xmlns:m="urn:example:catalog"><m:sku>42</m:sku></m:getPrice></env:Body>
  <env:Header><m:trace xmlns:m="urn:example:meta">abc-123</m:trace></env:Header>
</env:Envelope>
SOAP Header must appear before Body.
fixed
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  <env:Header><m:trace xmlns:m="urn:example:meta">abc-123</m:trace></env:Header>
  <env:Body><m:getPrice xmlns:m="urn:example:catalog"><m:sku>42</m:sku></m:getPrice></env:Body>
</env:Envelope>
No errors. Warnings may remain — a conforming feed can still be missing a self link — but nothing here is wrong.

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.