Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RestDataSource is not working

    Hi Team,

    I am getting an issue with RestDataSource. Please help me on this, This is my Rest Data source
    <RestDataSource xmlns:fmt="WEB-INF/" ID="documentApproval" dataFormat="xml" dataURL="/restDocApp">

    <fields>
    <field primaryKey="true" name="doc_app_id" type="integer" sequenceName="SEQ_APP_ID" hidden="true"></field>

    <field name="doc_id" lenght="3" type="text" >
    <title>id</title>
    </field>

    <field name="t_id" length="15" type="integer" hidden="true">
    <title><fmt:message key="tfb.common.partyId"/></title>
    </field>



    </fields>
    <recordXPath>/</recordXPath>
    <operationBindings>
    <operationBinding operationType="add"
    dataProtocol="postParams" dataURL="/restDocApp/add"/>

    <operationBinding operationType="fetch"
    dataProtocol="postParams" dataURL="/restDocApp/fetch"/>

    </operationBindings>
    </RestDataSource>

    Error logs:
    2021-01-15 11:29:57,221 WARN [http-/127.0.0.1:8888-5] (com.isomorphic.datasource.DataSourceDMI:217) - operationBinding for DataSource: documentApproval with operationType: fetchdocumentApproval_fetch does not have a <serverObject> in force and does not specify any operationBinding settings that could affect its behavior. This operation will almost certainly give the same result as a default operation, and so is almost certainly unnecessary
    2021-01-15 11:29:57,221 WARN [http-/127.0.0.1:8888-5] (com.isomorphic.datasource.DataSourceDMI:217) - operationBinding for DataSource: documentApproval with operationType: fetchdocumentApproval_fetch does not have a <serverObject> in force and does not specify any operationBinding settings that could affect its behavior. This operation will almost certainly give the same result as a default operation, and so is almost certainly unnecessary
    2021-01-15 11:29:57,221 WARN [http-/127.0.0.1:8888-5] (com.isomorphic.servlet.RequestContext:221) - dsRequest.execute() failed:
    c
    com.isomorphic.datasource.OperationNotSupportedException: Operation type 'fetch' not supported by this DataSource (ogaDocumentApproval)
    at com.isomorphic.datasource.DataSource.notSupported(DataSource.java:3903)
    at com.isomorphic.datasource.DataSource.executeFetch(DataSource.java:3807)
    at com.isomorphic.datasource.DataSource.execute(DataSource.java:2228)
    at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:629)
    at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:546)
    at com.isomorphic.application.AppBase.execute(AppBase.java:489)
    at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2813)
    at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:230)

    Regards,
    Chandu

    #2
    This code doesn't really make sense..

    RestDataSource is intended for calling from the browser to a REST service, so it's generally created only on the client-side in GWT Java. You would never use sequenceName in a RestDataSource - that's for SQLDataSource.

    Then, also, RestDataSource is a pre-built protocol, so setting recordXPath and other properties to customize the response format also does not make sense - if you have a custom response format, you would start with DataSource instead.

    Basically, please go back to the QuickStart Guide, and read the Data Integration chapter, and then continue on to the Server Framework chapter if appropriate.

    Comment


      #3
      Thanks a lot for your quick reply.

      I have removed setting recordXPath and other properties like sequenceName as well but still we are getting the same error.

      Could you help to provide sample code with XML based data source.



      Regards,
      Chandra

      Comment


        #4
        Also how to use the Rest api in DataSource xml to fetch the data?

        Comment


          #5
          Please start by reading the QuickStart Guide. Then, explain what you are trying to do.

          Comment

          Working...
          X