Talend ESB : Replace tWebServiceInput by REST webService tRestClient or tRestRequest component

I’m working on an Talend ESB project.

What I can’t do is: Replace the existing tWebServiceInput component (of type wsdl) with another REST webService (tRestClient or tRestRequest: I don’t know which is better).

We would like to use the verb GET and PUT in REST webService.

The existing job uses the tWebServiceInput component which contains java code, we build a character chain from the xml file, save the chain sent in a Response file, this one (java code) uses routines and in java code we also use the web service to create elements, then create an XML file.

In return, the java code returns two Response and pathfile variables

I would like to know how to replace tWebServiceInput by webService REST (tRestClient or tRestRequest) without using Java?

How to retrieve context variables in tRestClient?

Is it possible to do a sub-job for the tRestClient processing and then call on it in the main job.

    // EndPoint String endPoint = context.endPoint;  Routine1 Rout1 = new Routine1(); Rout1.method(endPoint); Routine2 Routine2 = Rout1.method3(); Routine3 stub = (Routine3)Routine2;  //INPUTS // Created Items file String tempFile = context.chemin_espace_travail + context.codeFlux + "/ALIM.xml";  // Creating String from XML file String xmlItem = routines.Sillage.XMLtoString(tempFile);  //Save the true string sent to response file String pathFileXMLSent=context.archiving_space_path+context.codeFlux+"/PUBLICATION/_URGENT_"+TalendDate.getDate("yyyyMMdd_hhmmss")+".xml"; Sillage.stringToXml(pathFileXMLSent, xmlItem);  // Call to WebService for the creation of items String responseAPP = stub.createItems(xmlItem, context.WS_TIMEOUT);   // Create XMl file String pathFile = context.archiving_space_path+context.codeFlux+"/PUBLICATION/_URGENT_"+TalendDate.getDate("yyyyMMdd_hhmmss")+".xml";   //save the response file Sillage.stringToXml(pathFile, responseAPP); // return row9.reponse = responseAPP; row9.pathFile = pathFile; 

Thanks in advance,

Best regards,

Job test TRestClient

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.