Versions Compared

Key

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

...

  1. Log into the management console of WSO2 EI and click Create under Data Service.
  2. Add a name for the data service and go to the next step.
  3. Connect to the Company database that you defined above. For information on how to connect to a RDBMS, see Adding an RDBMS datasource.
  4. Click Next to open the Queries screen.
  5. Click Add New Query to specify the query details:
    1. Enter EmployeeOfficeSQL as the query ID.

    2. Enter the following SQL dialect:

      Code Block
      select EmployeeNumber, FirstName, LastName, Email, JobTitle, OfficeCode from EMPLOYEES where OfficeCode=:OfficeCode
  6. Generate input and output mappings:
    1. Click Generate Input Mapping and an input mapping will be generated automatically for the OfficeCode field:
    2. Click Generate Response to automatically generate output mappings for the EmployeeNumberFirstNameLastNameEmailJob Title and Office Code fields.
  7. Save the EmployeeOfficeSQL query.

  8. Start creating a new query for the Company datasource:

    1. Enter listOfficeSQL as the query ID.

    2. Enter the following SQL dialect:

      Code Block
      select OfficeCode, AddressLine1, AddressLine2, City, State, Country, Phone from OFFICES
  9. Click Generate Response to create output mappings for the fields specified in the above query.
  10. Click Add New Output Mapping and specify the required values for the fields.

    1. Select Query for the Mapping Type field.

    2. Enter the employeeOfficeSQL query you created previously in the Select Query field.

    3. Save the output mapping

  11. Save the listOfficeSQL query.

  12. Click Next to open the Operations screen.
  13. Create an operation for the listOfficeSQL query as shown below.
  14. Save the listOfficeSQLOP operation.

  15. Click Finish to navigate to the Deployed Services window, from where you can manage data services.

...