is this possible to send cross site request by AJAX with a SOAP request and get XML response? and i want to convert my xml response to json format is there any framework (like mustache) to do this easily
is this possible to send cross site request by AJAX with a SOAP request and get XML response? and i want to convert my xml response to json format is there any framework (like mustache) to do this easily
Share Improve this question edited May 4, 2013 at 2:41 hippietrail 17k21 gold badges109 silver badges179 bronze badges asked Jul 26, 2011 at 4:39 GauravSTomarGauravSTomar 6141 gold badge7 silver badges26 bronze badges 4- Do you have access to the server? – Joe Commented Jul 26, 2011 at 4:44
- i also want to know how to send soap request to a sever by javascript – GauravSTomar Commented Jul 26, 2011 at 4:48
- XML can represent just about anything with attributes, namespaces, and values. Where JSON generally represents a structure, which is a list of strings, integers, doubles, dates, arrays, and the like. An example of the XML would be required in order to know what JSON could possibly represent it. Can any random XML be represented by JSON? I suppose if it were straight string values, ignoring all attributes, perhaps. – Brain2000 Commented Jul 26, 2011 at 4:57
- @Brain2000 Actually, depending on how you defined it, JSON can represent arbitrary set of XML, but it is bloated and unweildy. – cwallenpoole Commented Jul 26, 2011 at 5:59
1 Answer
Reset to default 1You can make use of xml2js node library. It converts xml to json and vice versa. But it doesn't uses templates. https://www.npmjs./package/xml2js