using parameters in tFileFetch

One Star

using parameters in tFileFetch

Im tring to fetch a an xml file from "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=Chicago,IL"
But instead of typing the URL can I use a variable insteadlik:
"http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query="+name+"";
Ii'm just getting started with talend can anyone help me out
Community Manager

Re: using parameters in tFileFetch

Hi
Yes, you can set a dynamic url with context variables, for example,
Create a context variable called name in context viewer, and then set a dynamic URL:
"http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query="+context.name
And you can load the value of context variable at runtime.
Let us know if you have any questions!
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: using parameters in tFileFetch

how do I load it at run time if I run the job as a webservice??
Community Manager

Re: using parameters in tFileFetch

Hi
Where does the value of name come from in your case? db? file? or input by user who call the webservice?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: using parameters in tFileFetch

from when a run the job through webservice.........so it will get the xml file according to the name I specify when runing the job
One Star

Re: using parameters in tFileFetch

something Like setting the value of the context variable when I run the job from webservice
One Star

Re: using parameters in tFileFetch

one question.......how do I set the arg if I want to call the webservice from a java program...........Im trying this
arg = "--context.param zip=94954";
arg = "--context_param date=2011-02-"
It says incompatible type: required org.talend.Args
found String
Community Manager

Re: using parameters in tFileFetch

one question.......how do I set the arg if I want to call the webservice from a java program...........Im trying this
arg = "--context.param zip=94954";
arg = "--context_param date=2011-02-"
It says incompatible type: required org.talend.Args
found String

Hi
Please report a new topic about this question if it is not related to this topic.
Thanks for your support!
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business