[Download] | [Documentation Home] | [Release Note]
This document provides step-by-step guide to creating a Data service using CSV file as the data source. You can find a running example inside WSAS_HOME/samples/Dataservice. (README file explains how to run the sample.)
You can find grammar for Data Service configuration file in the following URL.Data Services Specification
Your feedback on WSO2 WSAS is most appreciated. Please send them to our mailing lists.
In the WSO2 WSAS management console, click on Services on the left hand panel. In the Add New Service panel, click on Define Data Service.
Step 1 :In the Configuration box, from the Data Source dropdown, select CSV. A popup window will open up.
Here, Enter Database source details including the url or file system path to the csv file, column separator character, which row to start from and header details. To specify the number of rows to read, leave Max. no of rows to read as -1. After entering details click OK. Enter a name for the data service if you haven't done so. Click Next.
Step 2 :Click on New Query to create a new query for you data service. You will be presented with the Add New Query popup window.
Click the Add New Output Mapping button to define mappings for the query output.
When finished, click OK to close the popup windows. The main panel will look similar to the following.
Click Next.
Step 3 :In the next panel, click on Add New Operation to define operations for the data service.
In the popup window, the Query dropdown will list the queries you defined in the previous step. You can map them to operations here. Click Finish when done.
Step 4 :Your new data service will now be listed.
Click on your service in the services list to see the service management window.
Click the Configure DataService link at the bottom to make changes to the service configuration.
Step 6 :A sample response will look like the following.