Contributions
Re: Property Transfers get sid from the CDATA
Thx a lot for your answer, i saw that page but unfortunately couldn't understand how all it works ... i mean saxon parse and search. I always got Fri Oct 07 10:06:24 EEST 2021 sid [Error parsing source property [error: Unexpected element: CDATA]] But anyway i marked your comment as solution.1.4KViews0likes3CommentsRe: Property Transfers get sid from the CDATA
the solution was found, it is not very pretty but works def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def response = context.expand('${GetSID - GetSID#ResponseAsXml}') def holder = groovyUtils.getXmlHolder(response) node_data = holder.getNodeValue("//data") String str = node_data; //get data between the text String result1 = str.substring(str.indexOf("sid") + 1, str.indexOf("upgrades")); //delete all extra symbols in the string String result2 = result1.replaceAll('"',"") String result3 = result2.replaceAll(":","") String result4 = result3.replaceAll("id","") String result = result4.replaceAll(',',"") //set global variable com.eviware.soapui.SoapUI.globalProperties.setPropertyValue( "sid", result )1.4KViews0likes5CommentsProperty Transfers get sid from the CDATA
Hi all, can anybody halp with such problem. I got the response and now need to get sid (YkhXK0uq6HBPvn3zAAAE) from the xml CDATA <data contentType="text/plain; charset=UTF-8" contentLength="97"><![CDATA[0{"sid":"YkhXK0uq6HBPvn3zAAAE","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":20000}]]></data> i tried this one (based on this) def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def response = context.expand('${GET GetSID#ResponseAsXml}') def holder = groovyUtils.getXmlHolder(response) node_data = holder.getNodeValue("//data") context.sid = node_data.replaceAll("sid:", ""); log.info context.sid but it leds to error is it possible to get sid without groovy justto use the Property Transfers ?Solved1.4KViews0likes7CommentsRe: Property Transfers get sid from the CDATA
got a little bit off the ground def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def response = context.expand('${GetSID - GetSID#ResponseAsXml}') def holder = groovyUtils.getXmlHolder(response) log.info holder node_data = holder.getNodeValue("//data") context.sid = node_data.replaceAll("sid:\"", ""); log.info context.sid it returns 0{"sid":"3qMphUliksaYTtl1AAAG","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":20000} but how to get the "3qMphUliksaYTtl1AAAG" ?1.4KViews0likes6Comments