Contributions
Re: Parsing XML from response
Thanks. I'v e now partly achieved what I want. I can extract the <ns0:aansluitingIdentificatie from the xml file using the code: def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def holder = groovyUtils.getXmlHolder( "overeenkomstOpvragen - Request 1#Response" ) // define namespace holder.namespaces["ns"] = "http://www.stedin.net/interfaces/SiteCoreAdapter/services/contractrekeningOvereenkomstOpvragenResponse/1" // loop item nodes in response message for( item in holder.getNodeValues( "//ns:aansluitingIdentificatie" )) log.info "EAN : $item" I will need a little more help because i'm a tester who doen't really know how to program/script. What code should I add to create a line that lists ns0:aansluitingIdentificatie, ns0:productgroep, ns0:postcode, ns0:huisnummer, <ns0:straatnaam, <ns0:plaatsnaam> Also, you mentioned the apache poi. I checked the website but this also goes a little over my head. Should I firts install the apache POI classes in the SOAPUI folder or does soapui already include this functionality?9.5KViews0likes0CommentsParsing XML from response
Hi, First of all, i'm a compete noob to soapui. I've looked extensively trough the available explanations here http://www.soapui.org/scripting---prope ... properties and here http://www.robert-nemet.com/2011/11/gro ... oapui.html to solve my problem to no avail. Can anyone provide me with a step by step instructions to do the following i send a soap request from the response i get i want to parse some of the node data in a text file or show it in the script log. What i've tried so far, using some of the info on the above mentioned pages: i've made a testcase with the request Part of the rsponse i get: <ns0:body> <ns0:contractrekeningen> <ns0:contractrekening> <ns0:contractrekeningIdentificatie>200000000538</ns0:contractrekeningIdentificatie> <ns0:BTWcategorie>Energie Debiteur 21%</ns0:BTWcategorie> <ns0:communicatievoorkeur>Individueel Brief</ns0:communicatievoorkeur> <ns0:overeenkomsten> <ns0:overeenkomst> <ns0:overeenkomstIdentificatie>3000077614</ns0:overeenkomstIdentificatie> <ns0:begindatum>2013-10-01+02:00</ns0:begindatum> <ns0:productgroep>ELK</ns0:productgroep> <ns0:locatie> <ns0:locatieIdentificatie>5000018162</ns0:locatieIdentificatie> <ns0:adres> <ns0:postcode>3561CV</ns0:postcode> <ns0:huisnummer>10</ns0:huisnummer> <ns0:straatnaam>Euterpedreef</ns0:straatnaam> <ns0:plaatsnaam>UTRECHT</ns0:plaatsnaam> </ns0:adres> <ns0:aansluitingen> <ns0:aansluiting> <ns0:aansluitingIdentificatie>871687400009970233</ns0:aansluitingIdentificatie> then added a test step properties and created the property 'response' then added a test step Groovy Script (retrieved from the XML PArsing instructione site) def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def holder = groovyUtils.getXmlHolder("Properties#response") log.info holder.getNodeValue("//ns0:contractrekeningIdentificatie") log.info holder['//ns0:contractrekeningIdentificatie'] I ger an error: Unexpected end of file after null Am I on the right track here? Can anyone give a step by step explanation how to achieve this? Ideally I would like to create the output of all nodes in an structured way so i can paste it into excel. But I would already be very glad if i can extract all the ns0:aansluitingIdentificatie></ns0:aansluitingIdentificatie values from the response. But if i can also get for example the 'contractrekening', the 'adres' associated with this contractrekening and the 'aansluitingIdentificatie' associated with this 'contractrekening' etc etc this would be perfect! for example: contractrekening;adres;aansluitingIdentificatie9.6KViews0likes2Comments