July 30, 2023

tSOAP – Docs for ESB 7.x

tSOAP

Calls a method via a Web service in order to retrieve the values of the parameters
defined in the component editor.

tSOAP sends the defined
SOAP message with the given parameters to the invoked Web service and returns the value
as defined, based on the given parameters.

tSOAP Standard properties

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

The Standard
tSOAP component belongs to the Internet family.

Note:

To build Jobs that need to be deployed into the Talend Runtime , it is recommended to use the
tESBConsumer component which is best
suited for the Talend Runtime.

The component in this framework is available in all Talend
products
.

Basic settings

Schema and Edit schema

A schema is a row description, it defines the number of fields that will
be processed and passed on to the next component.

This component always uses a built-in, read-only schema.

By default, the schema contains three String type columns:

Header: stores the SOAP message
header of the response from the server end.

Body: stores the SOAP message body of
the response from the server end.

Fault: stores the error information
when an error occurs during the SOAP message processing.

If the Output in Document check box is
selected, the schema then contains only one Document type column named Soap, which stores the whole response SOAP message in the XML
format.

Click Edit schema to view the schema
structure.

Warning:

Changing the schema type may result in loss of the schema
structure and therefore failure of the component.

Use NTLM

Select this check box if you want to use the NTLM authentication
protocol.

Domain: Name of the client domain.

Need authentication

Select this check box and enter a user name and a password in the
corresponding fields if this is necessary to access the service.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

Use http proxy

Select this check box if you are using a proxy server and fill in the
necessary information.

Trust server with SSL

Select this check box to validate the server certificate to the client
via an SSL protocol and fill in the corresponding fields:

TrustStore file: enter the path (including
filename) to the certificate TrustStore file that contains the list of
certificates that the client trusts.

TrustStore password: enter the password
used to check the integrity of the TrustStore data.

ENDPOINT

Type in the URL address of the invoked Web server.

SOAP Action

Type in the URL address of the SOAPAction HTTP header field to be used to
identify the intent of the SOAP HTTP request.

SOAP version

Select the version of the SOAP system you are using.

Warning:

The required SOAP Envelope varies among
versions.

Use a message from the input
schema

Select this check box to read a SOAP message from the preceding component
to send to the invoked Web service.

When this check box is selected, the SOAP
message
field becomes a drop-down list allowing you to select
a Document type column to read an input XML
file.

Warning:

This option makes sense only when the
tSOAP component is connected with
an input component the schema of which contains a Document type column to read a valid SOAP
message.

Output in Document Select this check box to output the response message in XML
format.

SOAP message

Type in the SOAP message to be sent to the invoked Web service.
The global and context variables can be used when you write a SOAP message.

Note:

To use special Latin characters, use encoding CP1252 in the SOAP message
instead.

For further information about the context variables, see
Talend Studio
User Guide
.

Advanced settings

Use Kerberos

Select this check box to choose a tSetKerberosConfiguration component from the Kerberos configuration list.

Note:

The OnSubjobOk trigger of tSetKerberosConfiguration should be used for
connection with tSoap.

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

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 can be used as an input or as an intermediate
component.

Connections

Outgoing links (from this component to another):

Row: Main; Iterate

Trigger: Run if; On Component Ok; On
Component Error.

Incoming links (from one component to this one):

Row: Main; Iterate

Trigger: Run if; On Component Ok; On
Component Error.

For further information regarding connections, see
Talend Studio
User Guide
.

Fetching the country name information using a Web service

This scenario describes a two-component Job that uses a Web service to retrieve the
country name information of a given country code.

Procedure

  1. Drop the following components from the Palette
    onto the design workspace: tSOAP and tLogRow.

    tSOAP_1.png

  2. Connect tSOAP to tLogRow using a Row > Main
    link.
  3. Double-click tSOAP to open its Basic settings view and define the component
    properties.

    tSOAP_2.png

  4. In ENDPOINT field, type in or copy-paste the URL
    address of the Web service to be used between the quotation marks:
    “http://www.webservicex.net/country.asmx”.
  5. In the SOAP Action field, type in or copy-paste
    the URL address of the SOAPAction HTTP header field that indicates that you want to
    retrieve the country name information:
    http://www.webserviceX.NET/GetCountryByCountryCode.

    Note:

    You can see this address by looking at the WSDL for the Web service you are
    calling. For the Web service of this example, in a web browser, append
    ?wsdl on the end of the URL of the Web service used in the
    ENDPOINT field, open the corresponding web
    page, and then see the SOAPAction defined under the operation node:

  6. From the SOAP Version list, select the version of
    the SOAP system being used. In this scenario, the version is SOAP
    1.1
    .
  7. In the SOAP message field, enter the XML-format
    message used to retrieve the country name information from the invoked Web service.
    In this example, IS is used as the country code,
    so the message is:

  8. Save your Job and press F6 to execute it.

    The country name information of the given country code IS is returned and displayed on the console of the Run view.
    tSOAP_3.png

Using a SOAP message from an XML file to get country name
information and saving the information to an XML file

This scenario describes a three-component Job that uses a SOAP message from an
input XML file to invoke a Web service for the country name information which corresponds to
the country code IR, and writes the response to an XML file.

Dropping and linking the components

  1. Drop the following components from the Palette
    onto the design workspace: tFileInputXML,
    tSOAP, and tFileOutputXML.
  2. Connect the components using Row > Main links.

    tSOAP_4.png

Configuring the input component

  1. Double-click the tFileInputXML component to
    open its Basic settings view.

    tSOAP_5.png

  2. Click the […] button next to Edit schema to open the Schema dialog box.

    tSOAP_6.png

  3. Click the [+] button to add a column, give it
    a name, getCountryName in this example, and
    select Document from the Type list. Then, click OK to close
    the dialog box.
  4. In the File name/Stream field, enter the path
    to the input XML file that contains the SOAP message to be used, or browse to the
    path by clicking the […] button.

    The input file contains the following SOAP message and you can see that the
    given country code is IR:
  5. In the Loop XPath query field, enter
    "/" to define the root as the loop node of the input file
    structure.
  6. In the Mapping table, fill the XPath query column with "." to extract all
    data from context node of the source, and select the Get
    Nodes
    check box to build a Document
    type data flow.

Configuring the Web service via the tSOAP component

  1. Double-click the tSOAP component to open its
    Basic settings view.

    tSOAP_7.png

  2. In ENDPOINT field, enter or copy-paste the URL
    address of the Web service to be used between the quotation marks:
    “http://www.webservicex.net/country.asmx”.
  3. In the SOAP Action field, enter or copy-paste
    the URL address of the SOAPAction HTTP header field that indicates that you want
    to retrieve the country name information:
    http://www.webserviceX.NET/GetCountryByCountryCode.
  4. Select the Use a message from the schema check
    box, and select a Document type column from the
    SOAP Message list to read the SOAP message
    from the input file to send to the Web service. In this example, the input schema
    has only one column, getCountryName.
  5. Select the Output in Document check box to
    output the response message in XML format.

Configuring the output component

  1. Double-click the tFileOutputXML component to
    open its Basic settings view.

    tSOAP_8.png

  2. In the File Name field, enter the path to the
    output XML file.
  3. Select the Incoming record is a document check
    box to retrieve the incoming data flow as an XML document. Note that a Column list appears allowing you choose a column to
    retrieve data from. In this example, the schema contains only one column.

Executing the Job

  1. Press Ctrl+S to save your Job.
  2. Press F6, or click Run on the Run tab to execute the
    Job.

    The country name information that corresponds to the country code of IR is returned and the information is saved in the
    defined XML file.
    tSOAP_9.png


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