Forum Discussion
mamar
12 years agoContributor
Thanks for your time and code.
I used the code and dint get the required values, instead i get null as output. I changed a little and able to get what i need. Find the below code for your reference, if you need.
groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
holder = groovyUtils.getXmlHolder( "doLoanAcctTrnInq#Response" )
holder.namespaces["fnf"] = "http://www.fnf.com/xes"
holder.namespaces["ns"] = "http://www.ifxforum.org/IFX_150"
countLoanAcctTrnRec = holder.getNodeValue("count(//fnf:LoanAcctTrnRec)")
countLoanAcctTrnRec = countLoanAcctTrnRec.toInteger()
log.info "countLoanAcctTrnRec : $countLoanAcctTrnRec"
String CurAmtType
for(i = 1; i<=countLoanAcctTrnRec ; i++)
{
countCompositeCurAmt = holder.getNodeValue("count(//fnf:LoanAcctTrnRec["+ i +"]//ns:CompositeCurAmt)")
countCompositeCurAmt = countCompositeCurAmt.toInteger()
log.info "countCompositeCurAmt : $countCompositeCurAmt"
for(j = 1; j<=countCompositeCurAmt; j++)
{
CurAmtType = holder.getNodeValue("//fnf:LoanAcctTrnRec["+ i +"]//ns:CompositeCurAmt["+ j +"]//ns:CompositeCurAmtType")
log.info "CurAmtType : $CurAmtType"
if(CurAmtType.equals("TranTotal"))
{
CurAmt = holder.getNodeValue("//fnf:LoanAcctTrnRec["+ i +"]//ns:CompositeCurAmt["+ j +"]//ns:CurAmt//ns:Amt")
CurCode = holder.getNodeValue("//fnf:LoanAcctTrnRec["+ i +"]//ns:CompositeCurAmt["+ j +"]//ns:CurAmt//ns:CurCode")
log.info "CurAmt : $CurAmt"
log.info "CurCode : $CurCode"
}
}
}
I used the code and dint get the required values, instead i get null as output. I changed a little and able to get what i need. Find the below code for your reference, if you need.
groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
holder = groovyUtils.getXmlHolder( "doLoanAcctTrnInq#Response" )
holder.namespaces["fnf"] = "http://www.fnf.com/xes"
holder.namespaces["ns"] = "http://www.ifxforum.org/IFX_150"
countLoanAcctTrnRec = holder.getNodeValue("count(//fnf:LoanAcctTrnRec)")
countLoanAcctTrnRec = countLoanAcctTrnRec.toInteger()
log.info "countLoanAcctTrnRec : $countLoanAcctTrnRec"
String CurAmtType
for(i = 1; i<=countLoanAcctTrnRec ; i++)
{
countCompositeCurAmt = holder.getNodeValue("count(//fnf:LoanAcctTrnRec["+ i +"]//ns:CompositeCurAmt)")
countCompositeCurAmt = countCompositeCurAmt.toInteger()
log.info "countCompositeCurAmt : $countCompositeCurAmt"
for(j = 1; j<=countCompositeCurAmt; j++)
{
CurAmtType = holder.getNodeValue("//fnf:LoanAcctTrnRec["+ i +"]//ns:CompositeCurAmt["+ j +"]//ns:CompositeCurAmtType")
log.info "CurAmtType : $CurAmtType"
if(CurAmtType.equals("TranTotal"))
{
CurAmt = holder.getNodeValue("//fnf:LoanAcctTrnRec["+ i +"]//ns:CompositeCurAmt["+ j +"]//ns:CurAmt//ns:Amt")
CurCode = holder.getNodeValue("//fnf:LoanAcctTrnRec["+ i +"]//ns:CompositeCurAmt["+ j +"]//ns:CurAmt//ns:CurCode")
log.info "CurAmt : $CurAmt"
log.info "CurCode : $CurCode"
}
}
}