Contributions
SOAP XML Parsing with Groovy.
Hi, Here is my SOAP Request: 33 Manipal // //I need to get the Postcode value/text.so here is my Groovy Snippet To get the Postcode Text /Value ..But it didn't work...Because Of the presence of ":". def output = "" def rootNode = new XmlSlurper().parseText(xml) rootNode.each { output += it.text().trim() } log.info(output) log.info(rootNode.soapenv:Envelope.soapenv:Header.soapenv:Body.web:GetUKLocationByPostCode.web:PostCode.text()) But the same code works fine with the Normal XML (i.e, Doesn't contain ":" ). So, how to get the Postcode. Regards, Franky.5.7KViews0likes1CommentRe: handling session in response
thanks for the prompt response. i have tried with your code. but null value only it passes. i have used this groovy code: ------------------------------------- def step = testRunner.testCase.getTestStepByName( "GetUKLocationByPostCode - Request 1" ) def a = step.getPropertyValue( "//web:GetUKLocationByPostCode/web:PostCode" ) log.info(a) the response i got is : Fri Jul 27 11:07:11 IST 2007:INFO:null the value is null. thanks!!! ind3.2KViews0likes0CommentsRe: handling session in response
thanks, in case if i want to get a node value in request/response....how do i do that request ---------- 33 response ------------ <NewDataSet><br /> <Table><br /> <Town>Banavie</Town><br /> <County>Highland</County><br /> <PostCode>PH33</PostCode><br /> </Table><br /><br />how to get country or postcode in response or web:PostCode in request<br />in groovy<br /><br />thanks<br />ind3.2KViews0likes0Commentshandling session in response
Hi all, I have a SOAP request for Login and i am getting proper response for the user credentials. Now in the SOAP response the session id( )node is passed to it. I need to get the value of the session id from the response.so that i can use those values for next coming request. thanks ind7.7KViews0likes6Commentslog message
hi all, i have just created a groovy script and i want to see the value for that. how to read the value resulting from log information. i have used, def items = holder.getNodeValues( "//clientSession::*") for (item in items) { log.info( item ) } where to view the log info that holds the item value. i need to get the values of clientSession node and also suggest me that the above code snippet is correct? thanks ind thanks5.5KViews0likes1Comment