9

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

4
  • Do you have access to the server? Commented Jul 26, 2011 at 4:44
  • i also want to know how to send soap request to a sever by javascript 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. 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. Commented Jul 26, 2011 at 5:59

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

NPM packages are not available on the client-side (since OP mentions cross-site AJAX requests)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.