This scenario is similar to the previous one. It describes a Job that uses a tESBConsumer component to retrieve a valid email address with custom SOAP headers in the request message.
Drop the following components from the Palette onto the design workspace: a tESBConsumer, a tMap, two tFixedFlowInput, three tXMLMap, and two tLogRow.
Connect each of the tFixedFlowInput with a tXMLMap using the Row > Main connection.
Right-click the first tXMLMap, select Row > *New Output* (Main) from the contextual menu and click tMap. Enter payload in the popup dialog box to name this row.
Repeat this operation to connect another tXMLMap to tMap and name the output row header.
Right-click the tMap component, select Row > *New Output* (Main) from the contextual menu and click the tESBConsumer component. Enter request in the popup dialog box to name this row and accept the propagation that prompts you to get the schema from the tESBConsumer component.
Right-click the tESBConsumer component, select Row > Response from the contextual menu and click the third tXMLMap component.
Right-click the third tXMLMap component, select Row > *New Output* (Main) from the contextual menu and click one of the tLogRow components. Enter response in the popup dialog box to name this row.
Right-click the tESBConsumer component again, select Row > Fault from the contextual menu and click the other tLogRow component.
Configuring the tESBConsumer component
In this scenario, a public web service which is available at http://www.webservicex.net/ValidateEmail.asmx will be called by the tESBConsumer component to returns true or false for an email address. You can view the WSDL definition of the service at http://www.webservicex.net/ValidateEmail.asmx?WSDL for the service description.
In the design workspace, double-click the tESBConsumer component to open its Basic settings view in the Component tab.
Click the [...] button next to Service configuration.
In the dialog box that appears, type in: http://www.webservicex.net/ValidateEmail.asmx?WSDL in the WSDL field and click the refresh button to retrieve port name and operation name. In the Port Name list, select the port you want to use, ValidateEmailSoap in this example. Click OK to validate your settings and close the dialog box.
Select the Populate schema to repository on finish to retrieve the schema from the WSDL definition, which will be used by the tFixedFlowInput component. This option is only available to users of Talend Studio with ESB. If you don't have this option, please ignore it. The schema can be created manually in the tFixedFlowInput component, which will be shown later.
Click Finish to validate your settings and close the dialog box.
In the Advanced settings view, select the Log messages check box to log the content of the messages.
Configuring the tFixedFlowInput components
Double-click the first tFixedFlowInput component to open its Basic settings view in the Component tab.
For users of Talend Studio with ESB who have retrieved the schema from the service WSDL definition in the configuration of the tESBConsumer component, select Repository from the Schema list. Then click the [...] of the next field to show the Repository Content dialog box. Select the metadata under the IsValidEmail node to use it as the schema of the input message. Click OK to close the dialog box.
For users of Talend Studio without ESB, please go to the next step.
For users of Talend Studio without ESB, the schema need to be created manually. Select Built-In from the Schema list.
Click the [...] button next to Edit Schema. In the schema dialog box, click the [+] button to add a new line of String type and name it Email. Click OK to close the dialog box.
In the Number of rows field, set the number of rows as 1.
In the Mode area, select Use Single Table and enter
"firstname.lastname@example.org"into the Value field, which is the payload of the request message.
Configure the second tFixedFlowInput as the first one, except for its schema.
Add two rows of String type to the schema and name them id and company respectively.