Forum Discussion

durgaprasadn's avatar
durgaprasadn
New Contributor
16 years ago

SOAP UI Groovy parsing the Respons..node is always empty

My objective is to get the response values out of the Response that is obtained from the SOAP UI in the assertion script.

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent )


declare namespace ns4='http://www.xyz.com/schemas/xyz/abc';
declare namespace ns1='http://www.xyz.com/schemas/xyz/def';
declare namespace ns2='http://www.xyz.com/schemas/xyz/klm';
declare namespace ns3='http://www.xyz.com/schemas/xyz/pqr';

def appearanceColorResponse = responseHolder.getNodeValue("//ns2:message[1]/ns2:message-body[1]/ns1:person-detail[1]/ns3:person[1]/ns4:entity[1]/ns4:appeareance-color[1]);

I am getting the appearanceColorResponse as null.

Could some one please let me know If I am doing wrong?

(or)

Is there a better way of reading the response with name spaces present?

1 Reply