August 15, 2023

tESBProviderRequest – Docs for ESB 6.x

tESBProviderRequest

Wraps Talend Job as web service.

It waits for a request message from a consumer and passes it to the next
component.

tESBProviderRequest Standard properties

These properties are used to configure tESBProviderRequest running in the Standard Job framework.

The Standard
tESBProviderRequest component belongs to the ESB family.

This component is relevant only when used with one of the
Talend
solutions with ESB, as it should be used with the Service Repository node and the Data Service creation related wizard(s).

Basic settings

Property Type

Either Built-in or Repository
.

 

Built-in: No WSDL file is
configured for the
Job.

 

Repository: Select the desired
web service from the Repository, to
the granularity of the port name and operation.

Schema and Edit schema

A schema is a row description. It defines the number of fields (columns) to
be processed and passed on to the next component. The schema is either Built-In or stored remotely in the Repository.

Click Edit schema to make changes to the schema.
If the current schema is of the Repository type, three
options are available:

  • View schema: choose this option to view the
    schema only.

  • Change to built-in property: choose this
    option to change the schema to Built-in for
    local changes.

  • Update repository connection: choose this
    option to change the schema stored in the repository and decide whether to propagate
    the changes to all the Jobs upon completion. If you just want to propagate the
    changes to the current Job, you can select No
    upon completion and choose this schema metadata again in the [Repository Content] window.

 

Built-in: The schema is created
and stored locally for this component only. Related topic: see

Talend Studio User
Guide
.

 

Repository: The schema is created
and stored in the Repository, hence can be reused. Related topic:
see
Talend Studio User
Guide
.

Keep listening

Check this box when you want to ensure that the provider (and
therefore Talend Job) will continue listening for requests after
processing the first incoming request.

Advanced
settings

Log messages (Studio only) Select this check box to log the message exchange
between the service provider and the consumer. This option works in the
Studio only.

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a
Job level as well as at each component level.

Global Variables

Global Variables 

NB_LINE: the number of rows processed. This is an After
variable and it returns an integer.

CORRELATION_ID: the correlation ID by which chained
service calls will be grouped. This is a Flow variable and it returns a string.

SECURITY_TOKEN: the user identity information in the
request header. This is a Flow variable and it returns an XML node.

HEADERS_SOAP: the headers of the SOAP request. This is a
Flow variable and it returns all SOAP request headers.

HEADERS_HTTP: the headers of the HTTP request. This is a
Flow variable and it returns all HTTP request headers.

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see
Talend Studio

User Guide.

Usage

Usage rule

This component covers the possibility that a Talend Job can be
wrapped as a service, with the ability to input a request to a
service into a Job and return the Job result as a service
response.

The tESBProviderResponse
component can both deliver the payload of a SOAP message and also
access the HTTP and SOAP headers of a service.

The tESBProviderRequest component
should be used with the tESBProviderResponse component to provide a Job
result as a response, in case of a request-response communication
style.

When the SAML Token or the Service Registry is enabled in the
service runtime options and if the SAML Token exists in the request
header, the tESBProviderRequest
component will get and store the SAML Token in the component
variable for further use in the flow.

The tESBProviderRequest component
will get the Correlation Value in the request header if it exists
and stored it in the component variable. When the Business
Correlation or the Service Registry is enabled in the service
runtime options, the Correlation Value will also be added to the
response. In this case, tESBProviderRequest will create a Correlation Value
if it does not exist.

Note that the Service Registry option is only available if you
subscribed to Talend Enterprise ESB solutions. For more information
about how to set the runtime options, see the corresponding section
in the
Talend Studio User
Guide
.

Dynamic settings

Click the [+] button to add a row
in the table and fill the Code
field with a context variable to turn on or off the Keep listening option dynamically at
runtime.

When a dynamic parameter is defined, the corresponding Keep listening option in the Basic settings view becomes unusable.

For examples on using dynamic parameters, see Scenario: Reading data from databases through context-based dynamic connections and Scenario: Reading data from different MySQL databases using dynamically loaded connection parameters. For more information on Dynamic
settings
and context variables, see
Talend Studio User Guide
.

Limitation

A JDK is required for this component to operate.

Scenario: Service sending a message without expecting a response

This scenario applies only to a Talend solution with ESB.

The Jobs, which are built upon the components under the ESB/Web Services family, act
as the implementations of web services defined in the Services node of the Repository. They
require the creation of and association with relevant services. For more information
about services, see the related topics in the
Talend Studio User
Guide
.

In this scenario, a provider Job and a consumer Job are needed. In the meantime, the
related service should already exist in the Services
node, with the WSDL URI being
http://127.0.0.1.8088/esb/provider/?WSDL, the port name being
TEST_ProviderJobSoapBinding and the operation
being invoke(anyType):anyType.

The provider Job consists of a tESBProviderRequest, a
tXMLMap, and two tLogRow components.

Use_Case_tESBProviderRequest1.png
  • Drop the following components from the Palette onto the design workspace: a tESBProviderRequest, a tXMLMap,
    and two tLogRow.

  • Double-click tESBProviderRequest_1 in the
    design workspace to display its Component view
    and set its Basic settings.

Use_Case_tESBProviderRequest2.png
  • Select Repository from the Property Type list and click the three-dot button to
    choose the service, to the granularity of port name and operation.

Use_Case_tESBProviderRequest23.png
  • Click OK.

  • Click the three-dot button next to Edit
    schema
    to view the schema of tESBProviderRequest_1.

Use_Case_tESBProviderRequest3.png
  • Click OK.

  • Connect tESBProviderRequest_1 to tLogRow_1.

  • Double-click tLogRow_1 in the design
    workspace to display its Component view and set
    its Basic settings.

Use_Case_tESBProviderRequest4.png
  • Click the three-dot button next to Edit
    schema
    . and define the schema as follow.

Use_Case_tESBProviderRequest5.png
  • Connect tLogRow_1 to tXMLMap_1.

  • Connect tXMLMap_1 to tLogRow_2 and name this row as
    payload.

  • In the design workspace, double-click tXMLMap_1 to open the Map
    Editor
    .

  • On the lower right part of the map editor, click the plus button to add one
    row to the payload table and name this row as
    payload.

  • In the Type column of this
    payload row, select Document as the data type. The corresponding XML root is added
    automatically to the top table on the right side which represents the output
    flow.

  • In the payload table, right-click
    root to open the contextual menu.

  • From the contextual menu, select Create
    Sub-Element
    and type in response in the
    popup dialog box.

  • Right-click the response node and select As loop element from the contextual menu.

  • Repeat this operation to create a sub-element request of
    the root node in the input table and set the
    request node as loop element.

  • Click the request node in the input table and drop it to
    the Expression column in the row of the
    response node in the output table.

Use_Case_tESBProviderRequest6.png
  • Click OK to validate the mapping and close
    the map editor.

  • Double-click tLogRow_2 in the design
    workspace to display its Component view and set
    its Basic settings.

Use_Case_tESBProviderRequest7.png
  • Click the three-dot button next to Edit
    Schema
    and define the schema as follow.

Use_Case_tESBProviderRequest8.png
  • Save the Job.

The consumer Job consists of a tFixedFlowInput, a
tXMLMap, a tESBConsumer, and two tLogRow
components.

Use_Case_tESBProviderRequest9.png
  • Drop the following components from the Palette onto the design workspace: a tFixedFlowInput, a tXMLMap, a
    tESBConsumer, and two tLogRow.

  • Double-click tFixedFlowInput_1 in the design
    workspace to display its Component view and set
    its Basic settings.

Use_Case_tESBProviderRequest10.png
  • Edit the schema of the tFixedFlowInput_1
    component.

Use_Case_tESBProviderRequest11.png
  • Click the plus button to add a new line of string type and name it
    payloadString.

  • Click OK.

  • In the Number of rows field, set the number
    of rows as 1.

  • In the Mode area, select Use Single Table and input world in
    quotations into the Value field.

  • Connect tFixedFlowInput_1 to tXMLMap_1.

  • Connect tXMLMap_1 to tESBConsumer_1 and name this row as
    payload.

  • In the design workspace, double-click tXMLMap_1 to open the Map
    Editor
    .

  • In the output table, right-click the root node to open
    the contextual menu.

  • From the contextual menu, select Create
    Sub-Element
    and type in request in the popup
    dialog box.

  • Right-click the request node and select As loop element from the contextual menu.

  • Click the payloadstring node in the input table and drop
    it to the Expression column in the row of the
    request node in the output table.

Use_Case_tESBProviderRequest12.png
  • Click OK to validate the mapping and close
    the Map Editor.

  • Start the Provider Job. In the executing log you can see:

  • In the tESBConsumer_1
    Component view, set its Basic settings.

Use_Case_tESBProviderRequest13.png
  • Click the three-dot button next to the Service
    Configuration
    to open the editor.

Use_Case_tESBProviderRequest14.png
  • In the WSDL field, type in:
    http://127.0.0.1:8088/esb/provider?WSDL.

  • Click the Refresh button to retrieve port name and operation name.

  • Click OK.

  • In the Basic settings of the tESBConsumer, set the Input
    Schema
    as follow:

Use_Case_tESBProviderRequest15.png
  • Set the Response Schema as follow:

Use_Case_tESBProviderRequest16.png
  • Set the Fault Schema as follow:

Use_Case_tESBProviderRequest17.png
  • Connect tESBConsumer_1 to tLogRow_1 and tLogRow_2.

  • In the design workspace, double-click the tLogRow_1 component to display its Component view and set its Basic
    settings
    .

Use_Case_tESBProviderRequest18.png
  • Click the three-dot button next to Edit
    Schema
    and define the schema as follow:

Use_Case_tESBProviderRequest19.png
  • In the Job Design, double-click tLogRow_2 to
    display its Component view and set its
    Basic settings.

Use_Case_tESBProviderRequest20.png
  • Click the three-dot button next to Edit
    Schema
    and define the schema as follow.

Use_Case_tESBProviderRequest21.png
  • Save the Job.

  • Run the provider Job. In the execution log you will see:

    INFO: Setting the server’s publish address to be
    http://127.0.0.1:8088/esb/provider

    2011-04-21 14:14:36.793:INFO::jetty-7.2.2.v20101205

    2011-04-21 14:14:37.856:INFO::Started

    SelectChannelConnector@127.0.0.1:8088

    web service [endpoint: http://127.0.0.1:8088/esb/provider] published

  • Run the consumer Job. In the execution log of the Job you will see:

  • In the provider’s log you will see the trace log:


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x