title: Iterate Mediator over json arrays
body: <p>I'd like to iterate the results array of a json message </p>
  
  <pre><code>{ 
     "results":[ 
        { 
           "category":"mdl", 
           "subcategory":"ip", 
           "ip":"103.14.120.121", 
           "subtype":"IP-MDL", 
           "date":"1405074556", 
           "longitude":"75.3333", 
           "latitude":"19.8833", 
           "country":"India", 
           "city":"Aurangabad", 
           "organization":"Good Domain Registry Private Limited", 
           "isp":"Good Domain Registry Private Limited" 
        }, 
        { 
           "category":"mdl", 
           "subcategory":"ip", 
           "ip":"108.162.198.96", 
           "subtype":"IP-MDL", 
           "date":"1405074556", 
           "longitude":"-122.3933", 
           "latitude":"37.7697", 
           "country":"United States", 
           "city":"San Francisco", 
           "organization":"CloudFlare", 
           "isp":"CloudFlare" 
        } 
     ] 
  } 
  </code></pre>
  
  <p>unfortunately iteration mediator doesn't seem to accept non xpath expression 
  anyone knows how to iterate over the previous message json results the same way i do it in xml ?
  I'd like to use ESB json-native support but doesn't seem to be able to break down json messages as with XML (i've tried iterate mediator, json payload factory and script mediator without any success)</p>
  
  <pre><code>            &lt;iterate expression="json-eval(results)"&gt; 
                 &lt;target&gt; 
                    &lt;sequence&gt; 
                       &lt;property name="messageType" value="application/json" scope="axis2"/&gt; 
                       &lt;payloadFactory media-type="json"&gt; 
  &lt;format&gt; 
  { 
  "event":{ 
  "providerName":"$1", 
  "providerSource":"$2", 
  "providerClassification":"$3", 
  "providerVersion":"$4", 
  "body":{ 
  "results":{$5} 
  } 
  } 
  } 
  &lt;/format&gt; 
  &lt;args&gt; 
                                  &lt;arg value="bdigital"/&gt; 
                                  &lt;arg evaluator="json" expression="$.results.category"/&gt; 
  &lt;arg evaluator="json" expression="$.results.subcategory"/&gt; 
                                  &lt;arg value="1.0"/&gt; 
                                  &lt;arg evaluator="json" expression="$.results"/&gt; 
  &lt;/args&gt; 
  &lt;/payloadFactory&gt; 
                       &lt;call&gt; 
                          &lt;endpoint&gt; 
                             &lt;http method="post" 
                                   uri-template="http://BD-VM-PP-CIC01:8280/services/CICQueue"/&gt; 
                          &lt;/endpoint&gt; 
                       &lt;/call&gt; 
                    &lt;/sequence&gt; 
                 &lt;/target&gt; 
              &lt;/iterate&gt;
  </code></pre>
  
  <p>thanks in advance,</p>