Forum Discussion
mcgintym
16 years agoOccasional Contributor
I have tried a number of variations here and still the same message. I have 3 namespaces in the actual code. Woudl that make any difference ? Though I have tried naming all three. I am copying the actual script assertion X ing out the URL I can capture the request with no problem but the response remains as []. Can you see something I am missing here?
//Capture data returned from service and compare it to the database pull for the same ID's
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
//Capture Message Response
def holder = groovyUtils.getXmlHolder( messageExchange.responseContent );
holder.namespaces["S"] = "http://schemas.xmlsoap.org/soap/envelope/";
holder.namespaces["ns1"] = "http://www.cc.ddd/schema/Person";
holder.namespaces["ns2"] = "http://www.cc.ddd/schema/PersonService";
def responseVaId = holder.getNodeValue["//ns2:id"];//Capture Message Request
def request = groovyUtils.getXmlHolder( messageExchange.requestContent );
def requestPersonId = request.getNodeValue["//per:getContactInfo/per:personId"];
//Write to log value from Response
//log.info (holder.getNodeValue(["//ns2:id"]))
//Get property from DB Call = Loop
def propVaid = context.getProperty( "getVaIdFromDB", "va_id" )
// Verify that DB Data, Service REsponse match expected from DB Test Property
assert responseVaId == propVaid;
//assert (requestPersonId = propVaid)//This assertion passes when uncommmented
//write to log values of response and DB call
log.info (responseVaId+" "+propVaid);
//log.info (requestPersonId+" "+propVaid);
The same message is thrown with the responseVaId = []
//Capture data returned from service and compare it to the database pull for the same ID's
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
//Capture Message Response
def holder = groovyUtils.getXmlHolder( messageExchange.responseContent );
holder.namespaces["S"] = "http://schemas.xmlsoap.org/soap/envelope/";
holder.namespaces["ns1"] = "http://www.cc.ddd/schema/Person";
holder.namespaces["ns2"] = "http://www.cc.ddd/schema/PersonService";
def responseVaId = holder.getNodeValue["//ns2:id"];//Capture Message Request
def request = groovyUtils.getXmlHolder( messageExchange.requestContent );
def requestPersonId = request.getNodeValue["//per:getContactInfo/per:personId"];
//Write to log value from Response
//log.info (holder.getNodeValue(["//ns2:id"]))
//Get property from DB Call = Loop
def propVaid = context.getProperty( "getVaIdFromDB", "va_id" )
// Verify that DB Data, Service REsponse match expected from DB Test Property
assert responseVaId == propVaid;
//assert (requestPersonId = propVaid)//This assertion passes when uncommmented
//write to log values of response and DB call
log.info (responseVaId+" "+propVaid);
//log.info (requestPersonId+" "+propVaid);
The same message is thrown with the responseVaId = []