This documentation is for WSO2 Data Services Server 3.2.2. View documentation for the latest release.
CSV Sample - Data Services Server 3.2.2 - WSO2 Documentation
Skip to end of metadata
Go to start of metadata

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 services in WSO2 DSS.

About the sample

The CSV file (Products.csv), stored in the <DSS_HOME>/samples/resources/ 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 data services and operations.

Building the sample

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

Executing the sample

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. 

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