even defining ( response ) I'm getting error: java.lang.NullPointerException: Cannot invoke method text() on null object
I'm not sure why it can't resolve the path - unless the code below doesn't recognize the response context while performing the search?
// create groovyUtils
def response = context.expand( '${getRatedEventList-dateRange#Response#declare namespace m=\'http://vonage.com/services/sl\'; //m:GetRatedEventListResponse[1]/m:ratedEvents[1]}' )
def records = new XmlParser().parseText( response )
valuesOfCallingNumbers = []
records.each { eventAttributes ->
if ( eventAttributes['m:name'][0].text() == "Calling Number" )
valuesOfCallingNumbers.add( eventAttributes['m:value'][0].text() )
}