oasi711
oasi711

Reputation: 79

Talend Pass Dynamic values into tSOAP Message

I am using BD5.6.1 i am using the tSOAP component and if i use the blow flow it works fine. tsoap --> LogRow I can paste the SOAP Request message into SOAP Message section of the tsoap node and it works fine.. But now i want to read the excel file and dynamically pass the value to SOAP Message of tSOAP component how this can be done?

Sample SOAP Message i need to pass.

"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xml\" xmlns:urn=\"urn:HPD_Inc_Create_WS\">
<<urn:HelpDesk_Submit_Service>

<urn:First_Name>   </urn:First_Name>
<urn:Impact>  </urn:Impact>

</urn:HelpDesk_Submit_Service>
</soapenv:Body>
</soapenv:Envelope>"

the parameter is FirstName values are in the file . I need to read these value from excel file and construct the soap message and then send it to tSOAP Component.

I saw on the forum that we can do that

on tSOAP, define the SOAP message to use a dynamic value passed from tFileInputExcel like this: "...."+(String)globalMap.get("row1.First_Name")+"..."

//First_name is one of the column defined on tFileInputExcel, this column read the FirstName value from excel file.

But is not work for me

Upvotes: 0

Views: 774

Answers (1)

Ibrahim Mezouar
Ibrahim Mezouar

Reputation: 4051

You can do this:

enter image description here

Read your excel file, and for each row (tFlowToIterate) call tSOAP and send it the message you construct:

"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xml\" xmlns:urn=\"urn:HPD_Inc_Create_WS\">
    <soapenv:Body>
        <urn:HelpDesk_Submit_Service>
            <urn:First_Name>" + (String)globalMap.get("row10.FirstName") + "</urn:First_Name>
            <urn:Impact>  </urn:Impact>
        </urn:HelpDesk_Submit_Service>
    </soapenv:Body>
</soapenv:Envelope>"

the global variable row10.FirstName comes from the tFlowToIterate which by default creates a global variable called rowX.Column for each incoming row's column, which you can rename in the component settings.

You can also use tESBConsumer along with a tXMLMap to constuct your message.

Upvotes: 1

Related Questions