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.
tSOAP component belongs to the Internet family.
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 This component always uses a built-in, read-only schema. By default, the schema contains three String type columns: – Header: stores the SOAP message – Body: stores the SOAP message body of – Fault: stores the error information If the Output in Document check box is Click Edit schema to view the schema Warning:
Changing the schema type may result in loss of the schema |
Use NTLM |
Select this check box if you want to use the NTLM authentication Domain: Name of the client domain. |
Need authentication |
Select this check box and enter a user name and a password in the To enter the password, click the […] button next to the |
Use http proxy |
Select this check box if you are using a proxy server and fill in the |
Trust server with SSL |
Select this check box to validate the server certificate to the client
TrustStore file: enter the path (including
TrustStore password: enter the password |
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 |
SOAP version |
Select the version of the SOAP system you are using. Warning:
The required SOAP Envelope varies among |
Use a message from the input schema |
Select this check box to read a SOAP message from the preceding component When this check box is selected, the SOAP Warning:
This option makes sense only when the |
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. Note:
To use special Latin characters, use encoding CP1252 in the SOAP message For further information about the context variables, see |
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 |
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at a Job |
Global Variables
Global Variables |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component can be used as an input or as an intermediate |
Connections |
Outgoing links (from this component to another): Row: Main; Iterate
Trigger: Run if; On Component Ok; On Incoming links (from one component to this one): Row: Main; Iterate
Trigger: Run if; On Component Ok; On For further information regarding connections, see |
Fetching the country name information using a Web service
country name information of a given country code.
Procedure
-
Drop the following components from the Palette
onto the design workspace: tSOAP and tLogRow. -
Connect tSOAP to tLogRow using a Row > Main
link. -
Double-click tSOAP to open its Basic settings view and define the component
properties. -
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”. -
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:12<wsdl:operation name="GetCountryByCountryCode"><soap:operation style="document" soapAction="http://www.webserviceX.NET/GetCountryByCountryCode"/> -
From the SOAP Version list, select the version of
the SOAP system being used. In this scenario, the version is SOAP
1.1. -
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:123456789"<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET"><soapenv:Header/><soapenv:Body><web:GetCountryByCountryCode><!--Optional:--><web:CountryCode>IS</web:CountryCode></web:GetCountryByCountryCode></soapenv:Body></soapenv:Envelope>" -
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.
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
-
Drop the following components from the Palette
onto the design workspace: tFileInputXML,
tSOAP, and tFileOutputXML. -
Connect the components using Row > Main links.
Configuring the input component
-
Double-click the tFileInputXML component to
open its Basic settings view. -
Click the […] button next to Edit schema to open the Schema dialog box.
-
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. -
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:12345678<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET"><soapenv:Header/><soapenv:Body><web:GetCountryByCountryCode><web:CountryCode>IR</web:CountryCode></web:GetCountryByCountryCode></soapenv:Body></soapenv:Envelope> -
In the Loop XPath query field, enter
"/"
to define the root as the loop node of the input file
structure. -
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
-
Double-click the tSOAP component to open its
Basic settings view. -
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”. -
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. -
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. -
Select the Output in Document check box to
output the response message in XML format.
Configuring the output component
-
Double-click the tFileOutputXML component to
open its Basic settings view. -
In the File Name field, enter the path to the
output XML file. -
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
- Press Ctrl+S to save your Job.
-
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.