How to convert xml to json for rest api migration
- Step 1Capture a representative SOAP response — Use Charles Proxy, Fiddler, or a curl command to capture a real SOAP response from the legacy endpoint. Save or paste the full XML envelope including the SOAP headers.
- Step 2Convert to JSON — Paste the XML into the converter and enable 'Strip namespaces' to remove prefix clutter. For SOAP envelopes, paste only the <Body> content if the full envelope adds noise, or use the 'Unwrap SOAP envelope' toggle if available.
- Step 3Analyse the JSON shape — Review the output to understand how arrays are represented (repeated elements produce arrays), how attributes are mapped to @ keys, and whether any CDATA fields need special handling in your REST response schema.
- Step 4Design the REST JSON contract — Use the output as the basis for your OpenAPI schema definition. Identify fields to rename from XML conventions to camelCase, types to correct, and nested objects to flatten or restructure for the REST API response.
Frequently asked questions
How are XML attributes handled in the JSON output?+
Attributes are mapped to @ prefixed keys on the parent object by default — for example <item id="1"> becomes { "@id": "1", ... }. You can strip attributes entirely if they are only infrastructure metadata, or inline them as sibling keys without the @ prefix if you prefer a flatter JSON structure.
How do repeated XML elements (arrays) appear in the JSON?+
Repeated sibling elements with the same tag name are automatically collected into a JSON array. Single-occurrence elements remain as plain objects. This is a common source of type inconsistency when the test response has only one record — always test with responses containing two or more items to ensure consistent array wrapping in your schema.
Does the SOAP response data leave my browser?+
No. All XML parsing and conversion runs locally using fast-xml-parser. Production XML payloads containing customer records, authentication tokens, or financial data are never sent to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.