Back
What are some good tools for quickly and easily converting XML to JSON in Java?
To convert XML File in to JSON include the following dependency
<dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20140107</version></dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
and you can Download Jar from Maven Repository here. Then implement as:
String soapmessageString = "<xml>yourStringURLorFILE</xml>";JSONObject soapDatainJsonObject = XML.toJSONObject(soapmessageString);
String soapmessageString = "<xml>yourStringURLorFILE</xml>";
JSONObject soapDatainJsonObject = XML.toJSONObject(soapmessageString);
System.out.println(soapDatainJsonObject);
31k questions
32.8k answers
501 comments
693 users