Skip to main content

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

SOAP envelope

<env:Envelope>

The SOAP 1.2 document element: an optional Header followed by one required Body.

Envelope is the boundary of every SOAP message. Its namespace URI selects the SOAP version; the prefix itself is only a local alias.

The child order is fixed. Header, when present, comes before Body, and application payloads belong inside Body rather than beside the SOAP containers.

Parent
None — this is the document element
How many
Exactly one, as the document element.

Cardinality and constraints

Exactly one, as the document element.

  • Must use a SOAP envelope namespace URI.
  • Header must precede Body when both are present.

What our validator does

The XML validator checks that both examples are well-formed. It does not enforce this vocabulary's semantic content model, so the broken example is intentionally reported as valid XML.

We do not catch this one

This document is well-formed XML but violates a SOAP or XML Schema vocabulary rule. XML syntax alone cannot detect that defect; use a SOAP-aware processor or an XSD validator when conformance matters.

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>
No issue reported. This defect passes our checks.
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.