SOAP to JSON

Convert a SOAP XML envelope into JSON.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

SOAP to JSON Converter Online

The SOAP to JSON converter unwraps a SOAP envelope and turns the payload into clean JSON. Paste a request or response captured from SoapUI, a proxy log, or your application, and get the Body as a JSON object you can read, diff, or reuse in a REST client or JavaScript code.

What the converter does

  1. It checks that the root element is a SOAP Envelope and finds its Body — so you get a clear error when you paste plain XML or an HTML error page by mistake.
  2. The Body is converted element by element. Namespace prefixes are stripped, attributes become @name keys, and repeated elements become arrays.
  3. With Detect numbers & booleans on, values like 34.50 and true become JSON numbers and booleans; turn it off to keep every value as a string exactly as sent on the wire.

Header and version

By default only the Body content is returned — usually what you want when you are mapping a legacy service to a modern API. Switch on Include SOAP header & version to get an object with soapVersion, header (WS-Security tokens, correlation IDs, session data) and body. That view is handy when debugging authentication problems or tracing requests across systems.

Use cases

  • Inspecting responses of banking, logistics, or government SOAP services in a readable form.
  • Writing a REST façade: convert real responses to JSON to design the new API's schema.
  • Creating test fixtures and mock data from recorded SOAP traffic.
  • Comparing two responses with the JSON Diff tool after conversion.

Limitations

The tool converts the message you paste; it does not call the service. Binary attachments (MTOM/SwA) are not part of the XML envelope and therefore are not included.

To understand what operations a service offers, parse its contract with WSDL to JSON. For generic XML use XML to JSON, and to query a single value out of a response try the XPath Tester.

Frequently Asked Questions

Both SOAP 1.1 (http://schemas.xmlsoap.org/soap/envelope/) and SOAP 1.2 (http://www.w3.org/2003/05/soap-envelope). The envelope prefix does not matter — soap:, soapenv:, s:, or env: all work. With “Include SOAP header & version” on, the detected version is shown in the output.

Prefixes such as m: or ns2: only link elements to namespace URIs; they carry no data. The converter removes them so you get clean keys like GetStockPriceResponse and Price that are easy to access in JavaScript.

A <soap:Fault> in the body is converted like any other element, so faultcode and faultstring (or Code and Reason in SOAP 1.2) appear as JSON properties. When the header option is on, the output also contains "isFault": true.

Attributes become keys starting with @, and an element that has both attributes and text stores the text under #text. Elements that repeat, like several <Point> entries, are grouped into a JSON array.