DSS json convert issue for partial queries

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

DSS json convert issue for partial queries

Yasas Karunarathna
This post has NOT been accepted by the mailing list yet.
Hi there,

I have created a data service using DSS as below.

table schema : id(int), config_key(varchar), value(varchar), description(varchar)

DSS configuration:

   <query id="select_configs" useConfig="enki_ds">
      <sql>select ? from configs</sql>
      <result element="Entries" rowName="Entry">
         <element column="id" name="id" optional="true" xsdType="integer"/>
         <element column="config_key" name="config_key" optional="true" xsdType="string"/>
         <element column="value" name="value" optional="true" xsdType="string"/>
         <element column="description" name="description" optional="true" xsdType="string"/>
      </result>
     
   </query>
   <operation name="select_configs_operation">
      <call-query href="select_configs">
         <with-param name="param0" query-param="param0"/>
      </call-query>
   </operation>

SOAP request:
       
   <soapenv:Body>
      <dat:select_configs_operation>
         <dat:param0>id, value</dat:param0>
      </dat:select_configs_operation>
   </soapenv:Body>

  here we can pass parameters with any column combination like
     id
     *
     id, value

SOAP response:

   <soapenv:Body>
      <Entries xmlns="http://ws.wso2.org/dataservice">
         <Entry>
            <id>1</id>
            <value>name</value>
         </Entry>
         <Entry>
            <id>2</id>
            <value>email</value>
         </Entry>
      </Entries>
   </soapenv:Body>


Problem :

When I add the header 'Accept : application/json' to make it the response json, it will return below error

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

Am doing something wrong? Please help...