Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

This sample demonstrates the use of custom data source feature in DSS. It uses custom datasource org.wso2.carbon.dataservices.core.custom.datasource.InMemoryDataSource which uses the interface org.wso2.carbon.dataservices.core.custom.datasource.TabularDataBasedDS and org.wso2.carbon.dataservices.core.custom.datasource.EchoDataSource which uses org.wso2.carbon.dataservices.core.custom.datasource.CustomQueryBasedDS.

Table of Contents
maxLevel3
minLevel3

Building the sample

The sample data service InMemoryDSSample should be deployed using the instructions in Samples Setup section.

...

The sample service can be run using the TryIt tool, which is bundled with the WSO2 Data Services Server, or a code-generated java client sample as discussed in the Data Services Clients section.

Service description

.

 

Follow the steps below to demonstrate this functionality using the TryIt tool:

 

  1. Log in to the management console of your server and click List under Services in the navigator. The CSVSampleService will be listed here.
  2. Click Try this service to open the TryIt tool.
  3. Select the relevant operation and click Send to execute the command. The service contains the following operations:
    • "addVehicle": This operation adds a new vehicle to the datasource.
      Image Modified 
    • "getOldVehicles": This gives all the vehicles added with the year greater than 1970.
      Image Modified 
    • "getAllVehicles": This operation returns all the vehicles added in the datasource.
      Image Modified 
    • "getVehicleById": This operation gives the vehicle information which matches with the provided id. 
      Image Modified 
    • "getAllUsers": This operation returns the user information stored in the datasource.
      Image Modified 
    • "echo1" and "echo2": This operation returns the entered values.
      Image Modified

...

    • Image Modified