Skip to main content Skip to complementary content

Creating the data service consumer

To create your consumer, you need at least these components:
  • an input component allowing to read a data flow,
  • a tXMLMap component that will map this flat data to a hierarchical document, the format expected by ESB components,
  • the tESBConsumer components that will request the corresponding Web service and read its result,
  • and the tLogRow component that displays the Job execution result.

For this specific scenario, you will use a tFixedFlowInput as input component to send a country code request to the tESBConsumer component.

Creating the data service consumer Job

Procedure

  1. Right-click Job Designs in the Repository tree view and select Create Job.
  2. In the dialog box displaying then, only the first field (Name) is required. Type in airportJob and click Finish. An empty Job opens on the main window and you can continue to create the Job of interest.

Dropping and linking the components for the consumer

Procedure

  1. Click the tFixedFlowInput component from the Misc component group of the Palette, then click to the left of the design workspace to place it on the design area.
  2. Do the same to place tXMLMap, tESBConsumer and a tLogRow component from their respective group on the Palette.
  3. To link the input components to the mapper, simply right-click tFixedFlowInput, hold and drop it to tXMLMap.
  4. To link tXMLMap to tESBConsumer, right-click tXMLMap, hold and drag to tESBConsumer. A pop-up window displays, type in the name you want to give to the output row link: request, for example and then accept the propagation that prompts you to get the schema from tESBConsumer.
  5. Link the tESBConsumer component to it with a Response row link.

    The data service consumer Job looks like this:

    Screenshot of the Job in the design workspace.

Results

Then you need to configure each of these components.

Configuring the tFixedflowInput component

Procedure

  1. Double-click tFixedflowInput to open its Component view.
    Basic settings view.
  2. Click the three-dot button next to the Edit schema field to open the Schema window.
    Schema window.
  3. Click the plus button once to add one Column to the schema and name it country_code. Keep the Type field as string.
  4. Click OK to validate this schema. Then in the Mode area of the tFixedFlowInput basic settings, the active option should be Use Single Table and the country_code row is already added automatically to the Values table
  5. In the Value column of the Values table, type in CN in quotation marks.

Configuring the tXMLMap component

Procedure

  1. Double-click tXMLMap to open its Map editor.
    Map editor.
  2. To import the WSDL schema for the request, do the same as explained earlier when creating the data service provider. In this example, the request schema is getAirportInformationByISOCountryCode. For further information, see Configuring tXMLMap.
  3. Click country_code in the main flow table of the input side (left), hold, and drop it to the Expression column corresponding to the tns:CountryAbbrviation node in the XML tree of the request table on the output side (right).
    Information noteNote: In the real-world operations, tXMLMap is able to handle the highly complex transformations of hierarchical data.

    For all of the available features of tXMLMap, see tXMLMap operations.

  4. Click OK to validate this configuration.

Configuring the tESBConsumer component

Procedure

  1. Double-click the tESBConsumer component to open its Component view.
    Basic settings view.
  2. Click the [...] button next to the Service configuration field to open the WSDL editor.
  3. In the editor, browse to the WSDL file provided, the Port Name and Operation fields are automatically filled in with the ports and methods available in the Web service.
    WSDL editor.
  4. Select airportSoap in the Port Name field and select getAirportInformationByISOCountryCode in the Operation field.
  5. Click OK to validate the configuration.
    The tLogRow component will automatically retrieve the schema from the previous component. If not, double-click it and click the Sync columns button in its Component view.

Executing the consumer Job

Procedure

To execute this Job, press F6.

The Run view opens and displays the execution results.

Screenshot of the console results after successfully running the Job.

Results

This Job sends one country code request to the consumer that requests the Web service through the provider Job. The response is retrieved by the tESBProviderResponse and tESBConsumer components at the same time.

Although the provider Job received some request, it did not stop and is still listening to new requests.

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!