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
-
Do you have access to the server?Joe– Joe2011-07-26 04:44:16 +00:00Commented Jul 26, 2011 at 4:44
-
i also want to know how to send soap request to a sever by javascriptGauravSTomar– GauravSTomar2011-07-26 04:48:04 +00:00Commented 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– Brain20002011-07-26 04:57:20 +00:00Commented 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– cwallenpoole2011-07-26 05:59:43 +00:00Commented Jul 26, 2011 at 5:59
Add a comment
|
1 Answer
You can make use of xml2js node library. It converts xml to json and vice versa. But it doesn't uses templates. https://www.npmjs.com/package/xml2js
1 Comment
Rich Steinmetz
NPM packages are not available on the client-side (since OP mentions cross-site AJAX requests)