How do I return more than 1 record on the REST service with WSO2 DSS?

advertisements

I'm using WSO2 DSS with MySQL database. If I request just 1 record from database, it works correctly. But when I try to select more than 1 registry in a REST service, it doesn't works. The error is:

{
    "Fault": {
    "faultcode": "soapenv:Server"
    "faultstring": "Error while writing to the output stream using JsonWriter"
    "detail": ""
    }-
}

My data service:

<data name="item" transports="http https local">
<config enableOData="false" id="default">
  <property name="carbon_datasource_name">mysql</property>
</config>
<query id="selectActiveItems" useConfig="default">
  <sql>SELECT descricao FROM ITEM WHERE ativo = true and id_responsavel = ?</sql>
  <result escapeNonPrintableChar="true" outputType="json">{  "_item": {  "descricao":$descricao}}</result>
  <param name="id_responsavel" ordinal="1" sqlType="INTEGER"/>
 </query>
  <resource method="POST" path="selectActiveItems">
   <call-query href="selectActiveItems">
     <with-param name="id_responsavel" query-param="id_responsavel"/>
    </call-query>
   </resource>
</data>

There is any property to set that I didn't set?


The correct output to response more than 1 record from database is:

<result escapeNonPrintableChar="true" outputType="json">
  {"_itens":{"item": [ {"nome":$nome,"descricao":$descricao} ] }}
</result>