Skip to main content Skip to complementary content

Creating the data service provider

In this scenario, the data service provider uses the tESBProviderRequest and the tESBProviderResponse components to create the access to the airport Web service and uses the tXMLMap component to join the airport data provided by a given MySQL database into the request-response main flow for publication. The database data is loaded by the tMysqlInput component.

Creating the data service provider Job

Procedure

  1. Under the Services node of the Repository tree view, right-click the operation of the newly defined airport Web service and from the contextual menu, select Assign Job. In this scenario, this operation is getAirportInformationByISOCountryCode.
  2. The Assign Job wizard opens. Select the Create a new Job and Assign it to this Service operation and click Next.
  3. In the New Job view of the wizard, the Job to be created is already named automatically, so simply click Finish. A draft Job is opened on the workspace.

Dropping and linking the components for the provider

In the draft Job, a tESBProviderRequest and a tESBProviderResponse are already selected and configured. tESBProviderRequest will send a request to the specified Web service and tESBProviderResponse will send back the response corresponding to the request. These two components can be found in the ESB group of the Palette.

Procedure

  1. Right-click tESBProviderRequest, hold and drag to tESBProviderResponse to link these two components.
  2. Place a tXMLMap in the middle of the row link from the Palette and in the pop-up window, name the output link as, for example, airport_response. This will also be used as the name of the output table in the map editor of tXMLMap.

    Then your data service provider Job looks like this:

    Screenshot of the Job in the design workspace.

    The red cross icon prompts you to configure the tXMLMap component.

  3. From the Db Connections node of the Repository tree view, place the connection to the airport data, the airport database table in this example, onto the workspace. Then the Components wizard is opened.
    For more information on how to create a database connection in the Repository, see Managing metadata in Studio.
  4. Double-click tMysqlInput in this wizard to create the corresponding component on the workspace and link it to tXMLMap.

Results

In this scenario, the airport data is composed of airport names and the corresponding country codes. The following figure presents the database table in use.

Database table.

Until now, you need only to configure tXMLMap as the other components are already configured automatically.

Configuring tXMLMap

Procedure

  1. On the workspace, double-click tXMLMap to open its editor.
    Map editor.
  2. In the main row table of the input flow side (left), right-click the column name payload and from the contextual menu, select Import from Repository. Then the Metadatas wizard opens.
    For more information on how to create the XML tree, see Using the document type to create the XML tree.
  3. Expand the File XML node in this wizard, select the schema of the request side and click OK to validate this selection. In this example, the schema is getAirportInformationByISOCountryCode.
    Metadata wizard.
  4. Do the same to import the hierarchical schema for the response side (right). In this example, this schema is getAirportInformationByISOCountryCodeResponse.
  5. To create the join to the lookup data, click the CountryAbbrviation node in the main row of the input side (left), hold, and drop it onto the Exp.key column of the lookup flow, corresponding to the id row.
  6. On the table representing the lookup flow, click the wrench icon on the up-right corner to open the setting panel.
  7. Set Lookup Model as Reload at each row, Match Model as All matches and Join Model as Inner join.
    Screenshot of the lookup flow table.
    For more information about:
  8. Do the same to open the setting panel on the output side (right) and set the All in one option as true. This ensures that only one response is returned every time when one request is sent, as, otherwise, the airport data from the given database may provide several airports, thus several responses, to each country code that you send as one request.
    For more information about All in one, see How to output elements into one document.
    Screenshot of the output table.
  9. Click the name row in the lookup flow (left), hold, and drop it onto the Expression column corresponding to the tns:getAirportInformationByISOCountryCodeResult node in the XML tree view of the output flow (airport_response in this example).

    Then your tXMLMap editor looks like this:

    Map editor
    Information noteNote:

    In the real-world practice, you can also add hierarchical data for lookup.

  10. Click OK to close the editor and validate this configuration.

Executing the provider Job

About this task

Now that components are configured, the Job can be executed.

To do so, proceed as follows:

Procedure

Press F6 to run this Job and once launched, the Run view opens and displays the execution results.
Screenshot of the console results after successfully running the Job.

Results

The data service provider Job is executed, and will listen to all requests sent to the Web service until you click the Kill button to stop it as by default, the Keep listening option in the Basic settings view of tESBProviderRequest is selected automatically.

What to do next

You must configure the consumer Job that will send actual requests to the data service provider Job you just created.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!