This documentation is for WSO2 Enterprise Integrator version 6.3.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

Key

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

...

  1. Click Save.
  2. Now, let's create another query that can get the doctor information based on specialization.
    1. Click Add New Query to open the Add New Query screen.
    2. Enter the following values:

      FieldValue
      Query IDselect_DOCTORS_from_SPECIALITY_query
      Datasourcedefault 
      SQL
      Code Block
      SELECT NAME, HOSPITAL, SPECIALITY, AVAILABILITY, CHARGE FROM PUBLIC.DOCTORS WHERE SPECIALITY=?
    3. Click Generate Input Mappings and a new input mapping record will be created. 

    4. Edit the record and change the Mapping Name to SPECIALITY, and click Save. You will now have the following input mapping:

      Info

      Input mappings allow you to add parameters to a query so that you can set the parameter value when executing the query. According to the above definition, you need to provide the SPECIALTY SPECIALITY as an input in order to retrieve the data corresponding to the SPECIALTYSPECIALITY.

    5. Click Main Configuration, to go back to the main configuration after adding the input mapping.

    6. Click Generate Response to automatically create mappings for the fields. 

    7. Under the Result (Output Mapping) section, change the values of the following fields

      Grouped by elementDOCTORList
      Row nameDOCTOR

      The output mapping will be as shown below.

      Info

      Output mapping specifies how the data that is fetched from your query is shown in the response. Note that, by default, the output type is XML.

  3. Click Save and then click Next to open the Operations screen.
    Since we are exposing the data as a REST resource, we do not need an operation. An operation is needed only if you are exposing the data as a SOAP operation.
  4. Click Next to open the Resources screen.
    1. Click Add New Resources to open the Add Resources screen. 
      Let's first create a resource to invoke the select_all_DOCTORS_query:

      FieldValue
      Resource Path/getAllDoctors
      Resource MethodGET
      Query IDselect_all_DOCTORS_query
    2. Click Save to save the resource.
  5. Now, let's create another resource to invoke the select_DOCTORS_from_SPECIALITY_query.
    1. Click Add New Resources to open the Add Resources screen and enter the following details:

      FieldValue
      Resource Path/getDoctors
      Resource MethodGET
      Query IDselect_DOCTORS_from_SPECIALITY_query
    2. Click Save to save the resource.
  6. Click Finish after you have defined the resources to complete the data service creation process. You are now taken to the Deployed Services screen, which shows all the data services deployed on the server including the one you created. 
    created new data service group

...