2016-10-16 7 views
0

MySQL 데이터베이스에서 WSO2 DSS를 사용하고 있습니다. 데이터베이스에서 단 하나의 레코드를 요청하면 제대로 작동합니다. 하지만 하나 이상의 레지스트리를 REST 서비스에서 선택하려고하면 작동하지 않습니다. 오류 :WSO2 DSS를 사용하여 REST 서비스에서 레코드를 두 개 이상 반환하는 방법은 무엇입니까?

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

내 데이터 서비스 :

내가 설정하지 않은 것을 설정하는 모든 속성이 있습니다
<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> 

?

답변

1

데이터베이스에서 1 개 기록보다 더 많은 응답 올바른 출력은 다음과 같습니다 내가 전에 본 적이 및 메시지 빌더/포매터를 변경하여 해결할 수

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

.

내 대답을 참조하십시오. here.