Forum Discussion
nmrao
Champion Level 3
Also you check this example which is done some recently and same as yours ie., xml contains cdata and it contains json.
http://stackoverflow.com/questions/35623183/soapui-how-to-find-node-count-in-json-response/35626696#35626696
Other examples to get the json data
https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/AssertJsonArrayElement.groovy
Sphujidhwaj
9 years agoContributor
Hi,
CDATAXml = respXmlHolder.getNodeValue("//ns1:Result") log.info(CDATAXml) def data = new XmlSlurper().parseText(CDATAXml) def list = new groovy.json.JsonSlurper().parseText( data.toString()) log.info list.size()
When I try to run the above script I get an error "Content is not allowed in prolog"
The CDATAXml is very huge (I copied the content in text file it comes around 12000 lines)
Is the error due to huge data?
Please let me know if I am going wrong anywhere.
Thanks,
SD