Quick answer
A valid SOAP response must have a single root element named Envelope in the SOAP namespace (SOAP 1.1 or 1.2).
SOAP Invalid Envelope
A valid SOAP response must have a single root element named Envelope in the SOAP namespace (SOAP 1.1 or 1.2). If the root is missing, wrong, or has an incorrect namespace, validators report an invalid envelope error.
Common causes
- Root element is not Envelope (e.g. Body or a custom element at root).
- Wrong or missing SOAP namespace on Envelope.
- Multiple root elements or malformed XML declaration.
How to fix
- Use a single root <Envelope> with xmlns for SOAP 1.1 or SOAP 1.2.
- SOAP 1.1: xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; SOAP 1.2: http://www.w3.org/2003/05/soap-envelope.
- Validate XML well-formedness first, then check envelope structure.
Examples
Bad
<Body><GetResult>ok</GetResult></Body>
Good
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>...</soap:Body></soap:Envelope>
FAQ
- What is the SOAP envelope?
- The root XML element that wraps the entire SOAP message; it must be named Envelope and use the SOAP namespace.
- Can I use a custom root element for SOAP?
- No. The root must be Envelope; your payload goes inside Body or Fault.
Fix it now
Try in validator (prefill this example)