-
Book Overview & Buying
-
Table Of Contents
Talend Open Studio Cookbook
By :
This recipe shows how a RESTful web service can be called from Talend. The REST service we will be using is a Google maps service, so you will need to be connected to the Internet to perform this recipe.
Open the job jo_cook_ch09_0070_consumeRestService.
Drag a tRESTClient component onto the canvas.
Set the URL to http://maps.googleapis.com the Relative Path to "maps/api/geocode/xml".
Add two Query Parameters "address" with a value of "Trafalgar Square" and "sensor" with a value of "false".
Your tRestClient should look like the one below:

Link a tLogRow component to the response and error flows out of the tRestClient component.
Run the job.
The tRestClient is a component that enables us to define all of the features of a REST request. In this case, we define the URL of the Google APIs, and then the Geocoder API within the maps functions.
Finally, we define the address for which we wish to provide the information.