Contributions
Re: How to extract a value from a SOAP response
I try but still does not work; after the SOAP step I add the following groovy script: import com.eviware.soapui.support.* groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ); ResponseMessage = testRunner.testCase.testSteps["ADD_VP_NVS"].testRequest.response.contentAsString; ResParsed = new XmlSlurper().parseText(ResponseMessage) resOper = ResParsed.resultOperation err = ResParsed.errorCode log.info ResponseMessage log.info ResParsed log.info resOper log.info err The result of the four log.info are: log.info ResponseMessage: Mon Apr 08 16:41:46 CEST 2019:INFO:<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <ns1:processRequestResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://services.ni.devoteam.vpg.com"> <processRequestReturn href="#id0"/> </ns1:processRequestResponse> <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:NIResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:server.ws.ni.vpg.devoteam.com"> <resultOperation xsi:type="xsd:string">0</resultOperation> <errorCode xsi:type="xsd:string">0</errorCode> <errorDescription xsi:type="xsd:string">Operazione eseguita con successo</errorDescription> </multiRef> </soapenv:Body> </soapenv:Envelope> log.info ResParsed: Mon Apr 08 16:41:46 CEST 2019:INFO:00Operazione eseguita con successo log.info resOper andlog.info err: Mon Apr 08 16:41:46 CEST 2019:INFO: Mon Apr 08 16:41:46 CEST 2019:INFO: Regards Massimo5.9KViews0likes1CommentHow to extract a value from a SOAP response
I am new with SoapUI tool. I need to extract the values of "resultOperation" and "errorCode" from the following SOAP response: HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Mon, 08 Apr 2019 09:49:47 GMT <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <ns1:processRequestResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://services.ni.devoteam.vpg.com"> <processRequestReturn href="#id0"/> </ns1:processRequestResponse> <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:NIResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:server.ws.ni.vpg.devoteam.com"> <resultOperation xsi:type="xsd:string">0</resultOperation> <errorCode xsi:type="xsd:string">0</errorCode> <errorDescription xsi:type="xsd:string">Operazione eseguita con successo</errorDescription> </multiRef> </soapenv:Body> </soapenv:Envelope> Thanks MassimoSolved6KViews0likes4Comments