title: How do I iterate on a Map object returned from JsonSlurper.parse(JSONFile)?
body: <p>I'm using a Groovy script in Ready!Api 1.9.0 to decode a base64 string which is returned in a SOAP response and store the resulting JSON object in a json file. Then take that resulting file and parse it with JsonSlurper to get a Map object.</p>
  
  <p>This object needs to be iterated over so I can find a key and assert its value. I am unable to figure out why the keys aren't found. If I directly call a key using map.get(key) I get an error "No such property". If I directly call it using map.get('key') it returns null. I've also tried <code>Map.each{k -&gt; log.info("${k}")}</code> which returns 'interface.java.util.Map' and not the expected list of keys.</p>
  
  <pre><code>//create file path
  def respFile = "C:\\Users\\me\\Documents\\Temp\\response.json"
  
      //set originaldata in response to var
      def response1 = context.expand( '${Method#Response#declare namespace ns4=\'com/service/path/v4\'; declare namespace ns1=\'com/other/service/path/v4\'; //ns1:RequestResponse[1]/ns1:GetAsset[1]/ns1:Asset[1]/ns4:DR[1]/ns4:Sources[1]/ns4:Source[1]/ns4:OriginalData[1]}' )
  
      //decode the data
      byte[] decoded = response1.decodeBase64()
  
      //create file using file path above if it doesnt exist
      def rf = new File(respFile)
  
      //write data to file NOTE will overwrite existing data
      FileOutputStream f = new FileOutputStream(respFile);
      f.write(decoded);
      f.close();
  
  //begin second file
      import groovy.json.JsonSlurper;
      def inputFile = new File("C:\\Users\\me\\Documents\\Temp\\response.json")
      def parResp = new JsonSlurper().parse(inputFile)
  
      //test to find key
      Map.each{k -&gt; log.info("${k}")}
  </code></pre>
  
  <p>..
      //sample of the json before parse, not the full json though:</p>
  
  <pre><code>{
   "Response": {
   "ecn": 1000386213,
   "header": {
   "msgRefNum": "bbb-ls-123" 
  },
   "success": true,
   "duplicatedit": false,
   "subjectReturnCode": 1,
   "subject": [
   {
   "uu": 11264448,
   "name": {
   "name3": "WINSTON BABBLE",
   "dob": "19700422",
   "gender": "2",
   "ecCoded": "160824",
   "ecCodeSegment": "ZZ" 
  },
   "acc": [
   {
   "ftp": "01",
   "Number": "AEBPJ3977L",
   "issued": "20010101",
   "mMode": "R" 
  } ],
   "telephone": [
   {
   "telephoneType": "01",
   "telephoneNumber": "9952277966",
   "mMode": "R" 
  } ],
   "address": [
   {
   "line1": "M\/O HEALTH AND FAMILY WELFARE",
   "sCode": "07",
   "cCode": 110009,
   "ac": "04",
   "reportedd": "160430",
   "mMode": "R",
   "mb": "lakjsdf blorb" 
  },
  </code></pre>