1
我試圖調用服務在具有這種配置的DSS:WSO2 DSS:與空數據庫REST調用值
<query id="getAllPerformancesQuery" useConfig="lta_catalogue">
<sql>select idperformance, name, description from performance</sql>
<result element="performances" rowName="performance">
<element column="idperformance" name="idperformance" xsdType="integer"/>
<element column="name" name="name" xsdType="string"/>
<element column="description" name="description" xsdType="string"/>
</result>
</query>
<resource method="GET" path="performances">
<call-query href="getAllPerformancesQuery"/>
</resource>
用肥皂叫DSS很好地響應:
<performances xmlns="com.lta.catalog.CatalogDSS">
<performance>
<idperformance>1</idperformance>
<name>Introduction</name>
<description xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</performance>
</performances>
但隨着REST調用,則在列說明響應空值:
{"Fault":{"faultcode":"soapenv:Server","faultstring":"Error while writing to the output stream using JsonWriter","detail":""}}
與此異常日誌中:
Caused by: java.lang.IllegalStateException: Dangling name: description
at com.google.gson.stream.JsonWriter.close(JsonWriter.java:302)
at com.google.gson.stream.JsonWriter.endObject(JsonWriter.java:277)
at org.apache.axis2.json.gson.GsonXMLStreamWriter.writeEndElement(GsonXMLStreamWriter.java:394)
at org.wso2.carbon.dataservices.core.engine.XMLWriterHelper.endElement(XMLWriterHelper.java:110)
at org.wso2.carbon.dataservices.core.description.query.Query.writeResultEntry(Query.java:400)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processNormalQuery(SQLQuery.java:857)
... 54 more
任何想法?
thankx man this work .. – MaxExplode 2016-07-28 01:17:05