SOAP Response to JSON
SOAP XML responses including namespaces convert to JSON for easier processing in modern applications.
Switch tool:
Examples:
JSON output will appear here...
💡 Paste your XML and it converts to JSON automatically. Attributes are prefixed with @ and text content uses #text.
Code Examples
Here's how to achieve this in different programming languages:
1// Using DOMParser (browser) or xml2js (Node.js)2const xmlString = `<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">3 <soap:Body>4 <GetUserResponse>5 <user>6 <id>123</id>7 <name>John Doe</name>8 </user>9 </GetUserResponse>10 </soap:Body>11</soap:Envelope>`;1213// Browser14const parser = new DOMParser();15const doc = parser.parseFromString(xmlString, 'text/xml');1617// Node.js with xml2js (npm install xml2js)18const xml2js = require('xml2js');19const parser = new xml2js.Parser();20parser.parseString(xmlString, (err, result) => {21 console.log(JSON.stringify(result, null, 2));22});2324// Output:25// {26// "soap:Envelope": {27// "@xmlns:soap": "http://schemas.xmlsoap.org/soap/envelope/",28// "soap:Body": {29// "GetUserResponse": {...
More XML Examples
Simple XML to JSON
Basic XML element conversion to JSON object.
XML Attributes to JSON
XML elements with attributes converted to JSON with @ prefixed properties.
Nested XML to JSON
Deeply nested XML structures converted to nested JSON objects.
RSS Feed to JSON
Transform RSS feed XML into JSON format for web apps.
XML Config to JSON
Transform XML configuration files to JSON format.