About the SOAP Formatter
The SOAP Formatter pretty-prints and validates SOAP (Simple Object Access Protocol) XML messages. Paste a raw SOAP envelope — including the Header and Body — to produce an indented, readable structure with syntax highlighting. Useful for debugging web service calls, reviewing WCF or JAX-WS payloads, and inspecting WSDL-based API traffic captured from a proxy or network trace.
How to Use
- Paste your SOAP message into the input area. Include the full envelope from
to .
- Click Format. The tool parses and re-indents the XML, collapsing whitespace and aligning nested elements.
- Use the output to inspect the SOAP Header (authentication tokens, WS-Security blocks) and Body (operation payload, fault details).
- Copy the formatted output for documentation, bug reports, or pasting into your IDE.
SOAP Message Structure
Every SOAP message is an XML document following this envelope structure:
- Envelope (
) — The root element. Declares the SOAP namespace (http://schemas.xmlsoap.org/soap/envelope/ for SOAP 1.1, http://www.w3.org/2003/05/soap-envelope for SOAP 1.2) and any additional namespaces used in the body.
- Header (
) — Optional. Contains metadata: WS-Security tokens, routing information, transaction IDs, or custom authentication headers. Intermediary nodes may read and modify this section.
- Body (
) — Required. Contains the operation request or response payload. For faults, contains a element with error code, message, and detail.
- Fault (
) — Inside the Body on error responses. SOAP 1.1 uses and ; SOAP 1.2 uses and .
SOAP 1.1 vs SOAP 1.2
- Namespace — SOAP 1.1 uses
http://schemas.xmlsoap.org/soap/envelope/; SOAP 1.2 uses http://www.w3.org/2003/05/soap-envelope. The namespace in the envelope determines the version.
- HTTP binding — SOAP 1.1 uses
SOAPAction HTTP header to identify the operation. SOAP 1.2 uses the action parameter in the Content-Type header (application/soap+xml; charset=utf-8; action="...").
- Fault structure — SOAP 1.2 restructured fault elements for greater clarity and added subcodes for better error categorisation.
- Content-Type — SOAP 1.1 uses
text/xml; SOAP 1.2 uses application/soap+xml. Sending the wrong Content-Type is a frequent source of 415 Unsupported Media Type errors.
Common SOAP Formatting Issues
- Namespace prefix mismatch — A prefix like
soap: must be declared with xmlns:soap on the Envelope. Undeclared prefixes make the message not well-formed XML and will cause parse failures.
- Encoding special characters — Ampersands, angle brackets, and quotes inside element values must be XML-escaped (
&, <, >, "). Unescaped characters break the XML parser.
- Missing SOAPAction header — Many SOAP 1.1 endpoints require a
SOAPAction HTTP header. If you are calling a service and receiving a generic error, check that the SOAPAction matches the operation name defined in the WSDL.
- Mixed SOAP versions — Sending a SOAP 1.2 envelope to a SOAP 1.1-only endpoint (or vice versa) produces a version mismatch fault. Check the WSDL binding transport to confirm the expected version.
- WS-Security token expiry — SOAP faults citing
wsse:MessageExpired or wsu:Timestamp errors indicate the timestamp window in the WS-Security header has expired. Re-generate the security token with a current timestamp.
Frequently Asked Questions
- What is SOAP used for?
- SOAP is a protocol for structured information exchange in web services, most commonly over HTTP. It is the standard for enterprise integrations, financial services APIs, legacy ERP systems (SAP, Oracle), and government data exchanges. While REST has replaced SOAP for new public APIs, SOAP remains dominant in enterprise middleware, WCF services (.NET), and JAX-WS services (Java).
- How is SOAP different from REST?
- SOAP is a protocol with a strict message format (XML envelope), built-in error handling (Fault element), and optional standards for security (WS-Security), transactions (WS-AtomicTransaction), and reliable messaging (WS-ReliableMessaging). REST is an architectural style using standard HTTP verbs and any payload format (JSON, XML, etc.). SOAP is more verbose but provides stronger guarantees; REST is simpler and more flexible.
- How do I generate a SOAP request from a WSDL?
- Tools like SoapUI, Postman (with WSDL import), or IDE plugins (IntelliJ IDEA, Eclipse Web Tools) can read a WSDL and generate sample SOAP request skeletons. In code, Java's
wsimport, .NET's svcutil.exe, and Python's zeep library all generate typed client stubs from a WSDL URL.
- What does "not well-formed" mean in a SOAP context?
- A SOAP message is an XML document and must satisfy XML well-formedness rules: a single root element, all tags closed, attributes quoted, special characters escaped, and namespaces declared before use. A message that fails any of these rules will not parse and will be rejected before the SOAP processor even evaluates the envelope. The formatter will report the XML parse error with the line and character position of the problem.
- Can I use this formatter to debug SOAP faults?
- Yes. Paste the raw fault response returned by the service to inspect the
structure, read the faultcode and faultstring, and examine any element for application-specific error information. The formatted output makes nested fault detail blocks significantly easier to read than a single-line XML string.