This documentation is for WSO2 Enterprise Integrator version 6.2.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc

Versions Compared


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


  1. You can start creating a new data service in two ways:
    1. Open the dashboard (click Developer Studio -> Open Dashboard) and click Data Service.  
    2. Select the already created Data Service Project in the navigator, right click and go to New -> Data Service
    The New Data Service window will open as shown below.
  2. To start creating a data service from scratch, select Create New Data Service and click Next.

  3. Enter a name for the data service:

    Data Service NameRDBMSDataService
  4. Click Next and start adding the datasource connection details given below.

    Datasource IDDatasource
    Datasource TypeRDBMS
    Datasource Type (Default/External)Leave Default selected.
    Database EngineMySQL
    Driver Classcom.mysql.jdbc.Driver
    User Nameroot
  5. Save the data service.

A data service file (DBS file) will now be created in your data service project. Shown below is the project directory.


  1. Select the data service you created in the previous step.
  2. Right-click and click Add Query.
  3. Enter the following query details:

    Query IDGetEmployeeDetails
  4. Save the query. The query element is now added to the data service:
  5. Right-click the GetEmployeeDetails query and click Add SQL to add the following SQL statement:

    Code Block
    select EmployeeNumber, FirstName, LastName, Email from Employees where EmployeeNumber=:EmployeeNumber
  6. Save the SQL statement.
  7. Right-click the query again and click Add Input Mapping

  8. Enter the following input mapping details:

    Mapping NameEmployeeNumber
    Parameter TypeSCALAR
  9. Save the input mapping.
  10. Right-click the query again and click Add Output Mapping.

  11. Enter the following value to group the output mapping:

    Grouped by ElementEmployees
  12. Save the output mapping.

  13. Right-click the output mapping and go to Add Output Mapping → Add Element to create an element.

  14. Enter the following element details.

    Datasource Typecolumn
    Output Field NameEmployeeNumber
    Datasource Column NameEmployeeNumber
    Schema TypeString
  15. Save the element.
  16. Follow the same steps to create the following output elements:

    Datasource TypeOutput Field NameDatasource Column NameSchema Type
  17. Save the output elements.


  1. Right-click the data service and click Add Resource. Add the following resource details.

    Resource MethodGET
    Resource PathEmployee/{EmployeeNumber}
  2. Expand the GET resource, and click the GetEmployeeDetails (call-query). Connect the query to the resource by adding the following:

    Query IDGetEmployeeDetails
  3. Save the resource.

The data service should now have the resource added as shown below.


  1. You can start creating a registry resource in two ways:
    1. Open the dashboard (click Developer Studio -> Open Dashboard) and click Registry Resource.  
    2. Select the already created Registry Resource Project in the navigator, right click and go to New -> Registry Resource
    The New Registry Resource window will open as shown below.
  2. Select From existing template and click Next.

  3. Anchor
    Enter the following details:

    Resource NameSample_Policy
    Artifact NameSample_Policy
    Registry pathws-policy/
  4. Click Finish and the policy file will be listed in the navigator.
    1. Let's use the Design View to enable the required security scenario. For example, enable the Sign and Encyrptand Encrypt security scenario as shown below.


      Click the icon next to the scenario to get details of the scenario.

    2. You can also provide encryption properties, signature properties, and advanced rampart configurations as shown below.

      Localtab Group
      titleEncryption/Signature Properties

      titleRampart Properties

      titleUsing role-based permissions?

      For certain scenarios, you can specify user roles. After you select the scenario, scroll to the right to see the User Roles button.

      Either define the user roles inline or retrieve the user roles from the server.

      Localtab Group
      titleDefine Inline

      titleGet from the server

  5. Save the policy file.


  1. If you have already created a data service using Tooling, select the file from the Project Explorer. Alternatively, you can download this sample data service file and import it to your Tooling environment. 

  2. Once you have select the data service file, click the browse icon for the Policy field.

  3. Click workspace, to add the security policy from the current workspace. You can select the path to the sample_policy.xml file that you created in the previous steps.
  4. Click OK, and the security policy will be added to the data service.
  5. Save the data service.