how to call a rest web service(job) from java class

One Star

how to call a rest web service(job) from java class

Hello,
I have created a job which is used to save data into databse..
we take the input from URL like http://localhost:8088/c1/c2/hello.
here we save the hello message in databse table.
I want to call this rest service from a JAVA class then how can I call it.
I have attached a image of job structure with this post.
please help ASAP.
Note:- please tell if i have to deploy this job before calling it from JAVA class.If i have to deploy it then please tell how can i do that??
Regards,
Balaji Mule
Community Manager

Re: how to call a rest web service(job) from java class

Hi
Yes, you have to start the job in Talend Studio to launch the webservice before you call the webservice, or deploy the webservice in Talend runtime and start it, see this online tutorial to know how to deploy a webservice in Talend runtime.
http://www.talendforge.org/tutorials/tutorial.php?language=english&idTuto=102
How to call a Rest webservice?
In Talend Studio, you can create a DI job, use tRestClient or tRest component to call the Rest webservice, and if you want to call the webservice in a Java class, you just need to export the DI job and call it in a Java class in Eclipse, for more instructions, please read the following KB article in THC.
https://help.talend.com/search/all?query=Calling+a+Talend+Job+from+an+external+Java+application&cont...
I hope this answer will give you a tip and help you!

Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business