title: WSO2 ESB Iterate over DSS response (json array)
body: <p>I have a problem to iterate over call response of a dss. I have 2 servers</p>
  
  <p>WSO2 ESB server (4.9.0)
  WSO2 Application Server (5.3.0) with Data Service (4.3.4) feature installed</p>
  
  <p>i make a payload</p>
  
  <pre><code>  &lt;payloadFactory media-type="xml"&gt;
      &lt;format&gt;
        &lt;p:valoresReport xmlns:p="ReportsDataService"&gt;
          &lt;xs:uuid xmlns:xs="ReportsDataService"&gt;$1&lt;/xs:uuid&gt;
        &lt;/p:valoresReport&gt;
      &lt;/format&gt;
      &lt;args&gt;
        &lt;arg value="123456789"/&gt;
      &lt;/args&gt;
    &lt;/payloadFactory&gt;
  </code></pre>
  
  <p>and do a call through an endpoint</p>
  
  <pre><code>  &lt;call blocking="true"&gt;
      &lt;endpoint key="ReportsDataServiceEndPoint"/&gt;
    &lt;/call&gt;
  </code></pre>
  
  <p>The response is:</p>
  
  <pre><code>&lt;ReportRowSet xmlns="ReportsDataService"&gt;
     &lt;reportRow&gt;
        &lt;column1&gt;1&lt;/column1&gt;
        &lt;column2&gt;2&lt;/column2&gt;
        &lt;column3&gt;3&lt;/column3&gt;
     &lt;/reportRow&gt;
     &lt;reportRow&gt;
        &lt;column1&gt;columna 1&lt;/column1&gt;
        &lt;column2&gt;olumna 2&lt;/column2&gt;
        &lt;column3&gt;columna 3&lt;/column3&gt;
     &lt;/reportRow&gt;
  &lt;/ReportRowSet&gt;
  </code></pre>
  
  <p>To read the response, i change de messageType to json</p>
  
  <pre><code>  &lt;property name="messageType" scope="axis2" type="STRING" value="application/json"/&gt;
  </code></pre>
  
  <p>and get the value with json-eval.</p>
  
  <pre><code>  &lt;property expression="json-eval($.ReportRowSet.reportRow)" name="rows"
      scope="default" type="STRING"/&gt;
  </code></pre>
  
  <p>I can log the property</p>
  
  <pre><code>  &lt;log level="custom"&gt;
      &lt;property expression="$ctx:rows" name="ROWS"/&gt;
    &lt;/log&gt;
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>[2016-05-31 16:21:38,489]  INFO - LogMediator ROWS = [{"column1":1,"column3":3,"column2":2},{"column1":"columna 1","column3":"columna 3","column2":"olumna 2"}]
  </code></pre>
  
  <p>But when i try to iterate the rows, i dont know how to do this (this way does not work)</p>
  
  <pre><code> &lt;iterate continueParent="true" expression="$ctx:rows"
      id="MyIterator" sequential="true"&gt;
      &lt;target&gt;
        &lt;sequence&gt;
        ...
  </code></pre>
  
  <p>also i tried with no success (without changing the messagetype):</p>
  
  <pre><code>  &lt;iterate continueParent="true" expression="//ReportRowSet/reportRow"
      id="MyIterator" sequential="true"&gt;
  </code></pre>
  
  <p>whats the correct form to do this integration and iteration.</p>
  
  <p>I let you my dss and sequence:</p>
  
  <p>ReportsDataService.dbs: [<a href="https://drive.google.com/open?id=0B44t8SdKZz79ellKVmpkM0t6Rmc" rel="nofollow">https://drive.google.com/open?id=0B44t8SdKZz79ellKVmpkM0t6Rmc</a> ]</p>
  
  <p>GenerarReporteSequence.xml: [<a href="https://drive.google.com/open?id=0B44t8SdKZz79YlkxMnNnNm8weGs" rel="nofollow">https://drive.google.com/open?id=0B44t8SdKZz79YlkxMnNnNm8weGs</a> ]</p>