Prepare a Fictional SOAP Envelope for Human Review

Format and inspect a synthetic SOAP envelope without exposing credentials or confusing readable XML with protocol validation.

By DevSphere Editorial · · 5 min read

Open XML Tools

Use a synthetic envelope

SOAP messages are XML documents, but merely formatting an envelope does not validate its service contract or authenticate a caller. XML Tools includes a SOAP subtool entry that formats XML using the shared formatter; it does not execute a SOAP request. Use a synthetic envelope with a fictional operation and harmless values. Never paste an actual username, password, bearer token, or customer record into a general-purpose tool. The example below includes a header and body so a reviewer can check their relative placement and namespace prefixes. Our goal is visual inspection for a design discussion, not transport testing. The browser parser can establish basic XML well-formedness, while a SOAP implementation and WSDL or schema validator are needed to check protocol requirements.

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="urn:demo:soap" xmlns:d="urn:demo:data"><soap:Header><d:Trace>trace-demo</d:Trace></soap:Header><soap:Body><d:Lookup><d:Item>BOX-3</d:Item></d:Lookup></soap:Body></soap:Envelope>

Format under the SOAP tab

Open XML Tools and choose SOAP Formatter in the navigation. The input label changes to SOAP Envelope Input. Paste the sample, select an Indent size, and decide whether Preserve Comments is appropriate; this example contains none. The Formatter path validates through DOMParser before applying its simple tokenization and indentation. The resulting output should show one soap:Envelope with soap:Header followed by soap:Body. Check the namespace declarations at the root and confirm the d prefix appears on the trace and lookup elements. The tool does not normalize namespace prefixes or inspect namespace URIs for SOAP compliance. Its SOAP tab is a formatting mode, not a separate protocol analyzer. Copy Output copies formatted XML, but retain the input version because layout transformations may not preserve exact bytes.

Review header and body placement

Read the formatted tree from top to bottom. Trace should be inside Header and carry trace-demo. Lookup should be inside Body, with Item BOX-3 nested inside Lookup. This simple parent-child check can catch an accidental misplaced closing tag or a body field pasted into a header. For an interactive tree, choose Viewer or Parser; the tree displays elements and attributes and lets you expand nested nodes. It does not show SOAP action headers, HTTP transport headers, or a request-response exchange. If a body contains repeated elements, verify all occurrences and their order. XML text values are strings at this stage, even when they resemble numbers or identifiers. Do not decide that a message is valid for an endpoint solely because the formatted tree looks plausible.

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="urn:demo:soap" xmlns:d="urn:demo:data">
  <soap:Header>
    <d:Trace>trace-demo</d:Trace>
  </soap:Header>
  <soap:Body>
    <d:Lookup>
      <d:Item>BOX-3</d:Item>
    </d:Lookup>
  </soap:Body>
</soap:Envelope>

Know the protocol and formatting limits

The formatter is shared with general XML and does not resolve a WSDL, check SOAP version rules, validate an operation's input type, or enforce required headers. It does not perform XPath queries despite broad catalog language. Namespace prefixes can be arbitrary aliases when correctly bound, so compare namespace URIs and the endpoint's contract rather than relying only on prefix names. The regex-based formatter may alter presentation in mixed content, and Preserve Comments only controls whether the formatter includes comments it tokenizes. Avoid using it for signed SOAP messages or security-sensitive canonicalization. For real interoperability, use a SOAP client and the service's WSDL/XSD definitions in an approved test environment. Keep real secrets in a managed credential store, never in the sample or article.

Troubleshoot and confirm the demo

If Formatter shows the input rather than a formatted result, run Validator and inspect any parser error. Ensure every prefix used in a tag is declared, all tags are balanced, and attribute values are quoted. The XML Validator reports well-formedness, a few basic warnings, and document information, but it is not a schema validator. After formatting, check the envelope root, header trace, body operation, and item value against the demo contract. If a team needs to test the request, use a SOAP client with a mock or test endpoint and verify the actual response; formatting is not a network call. Clear the input before inspecting a different message. Keep the whole exercise synthetic and record which claims came from a contract versus what was only visible in the XML structure.

A useful review checklist can name protocol details that this page cannot establish: the expected SOAP version, action or transport headers, body operation namespace, and required fault behavior. Confirm each item against a WSDL or service contract rather than inferring it from a prefix or element label. The sample uses a made-up namespace URI to avoid implying a real endpoint. If an example is copied into a SOAP client, replace it only with approved test credentials and a controlled endpoint. The SOAP Formatter tab changes indentation and can preserve or omit comments, but it does not validate authentication headers or execute the operation. Store a sanitized request template in the team's test fixtures and run a test client that checks both request serialization and response parsing. That is the appropriate place to prove protocol compatibility.

During manual inspection, keep transport and message layers separate. The XML text shown here is only the envelope body representation; HTTP method, content type, SOAPAction behavior, TLS configuration, and server response are outside this editor. A complete test should assert the request's namespace-qualified operation and expected body values, then inspect the returned status and fault structure. If the service uses WS-Security or signed headers, preserve the original security tooling rather than reformatting a live message. For this demonstration, the fake trace value is intentionally not an authentication credential. Use the Formatter to make a sanitized example easier to review, then refer to the service's actual contract and client test for any decision about interoperability.

Browse all tutorials