Versions Compared

Key

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

Using CSV files is an easy and common way of storing simple tabular data. This sample demonstrates the usage of a CSV file as a data source for data service services in WSO2 DSS.

Table of Contents
maxLevel3
minLevel3

About the sample

The CSV file (Products.csv), stored in the <DSS_HOME>/samples/resources/Products.csv folder contains data about the products that are manufactured in an automobile company. Products refer to cars/motorocyles. The data table has the following columns: "ID", "Name", "Classification" and "Price". The sample data service used in this demonstration (CSVSampleService.dbs), contains a single operation named getProducts , which lists all the products that are manufactured in the company.

See Data Services and Resources for a definition of datasources data services and operations.

Building the sample

The sample data service ,named CSVSampleService should be deployed using the instructions in Samples Setup.

...

  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 "getProducts" operation and click Send to execute the request. You will get the a product list in the response as shown below.