Forum Discussion
I am glad you posted an alternate solution to this problem. I will mark this post as resolved now.
Regards,
Marcus
SmartBear Support
- harry5 years agoContributor
I dont see here he is converting json to xml. He still parsing using Jsonsulpher.
//Conversion from json to xml
def jsontoxml;
XMLSerializer xmlSerializer = new XMLSerializer();
JSON json = JSONSerializer.toJSON(parsed_json);
xmlSerializer.setTypeHintsEnabled(false);
jsontoxml = xmlSerializer.write(json);
log.info "JSON Response converted to XML Response Result:" + jsontoxml;currenlty i have in code where Ready 2.1.0 works. but now when i try to upgrade Ready 2.8.2 i was getting error.
import net.sf.json.JSON
import net.sf.json.JSONSerializer
import net.sf.json.xml.XMLSerializerare not working
- AlexKaras5 years agoChampion Level 3
Hi,
May I wonder why do you expect net.sf... objects to be imported? Are they in jars that are installed with ReadyAPI? Or have you provided ReadyAPI with the access to the relevant jar(s)?
Have you considered some alternative approach(es)?
For example:
https://stackoverflow.com/questions/29937254/convert-json-to-xml-using-groovy
http://groovy-lang.org/json.html (paragraph about "(
XmlSlurper
for XML being one example)") ?- harry5 years agoContributor
Earlier i was using groovy-1.8.0 jar. I didnot get this issue. It would have been better if you have told what jars to be installed rather posting random question to me.It would have helped me. Here issue is converting json to XML. not parsing json.Even i know based on the error message jar is missing. But dont know what i should install.Ready APi-Ready APi 2.8 coming with Groovy jar-2.4.4 jar. That is having issue. Anyways i figured out the solution. I installed the jars(ezmorph-1.0.1.jar & json-lib-2.4-jdk15.jar). That will solve the problem. If any have any issues like me.
Related Content
- 4 years ago
- 2 years ago
- 11 years ago
- 3 years ago