One Star

Read XML Input from URL (instead of File)

Hi forumites,
I just started evaluating TOS as replacement for Apatar, which seems to be ceased sadly.
One thing we have to use very often is reading XML data from an URL which looks like this:
https://url.com/getxml.php?get=1¶=12345¶=*****¶=14¶=2¶=2
Calling this URL generates a standard XML object:


3807071829
own


I want to read this XML input, transform and put it into a MySQL database.
The only XML input I found in TOS so far is file base - how to realize the URL based XML input?
After all its pretty much the same thing, in Apatar its the same connector handling both.
Thanks for reading!

  • Data Integration
10 REPLIES
Moderator

Re: Read XML Input from URL (instead of File)

Hi,
I think you can use component cHttp in talend ESB product to read your XML content from url.
Best regards
Sabrina
One Star

Re: Read XML Input from URL (instead of File)

Hi Sabrina,
thx for your reply!
I was using TOS for Data Integration... there is no cHttp connector.
Downloading ESB now, what is it with all these editions anyway?
I´ve been reading all night, still not really getting it.
Will post any outcomes here.
Smiley Happy
Moderator

Re: Read XML Input from URL (instead of File)

Hi,
I was using TOS for Data Integration... there is no cHttp connector.
Downloading ESB now, what is it with all these editions anyway?

We have "All" Version talend product, however, it is only available in Talend Enterprise Subscription Version.
I´ve been reading all night, still not really getting it.

I have made a simple demo job, hope it will be helpful for you.
Best regards
Sabrina
One Star

Re: Read XML Input from URL (instead of File)

Hi Sabrina,
wow... thanks a lot for doing this.
I have TOS ESB 5.3.1 installed now, but I cant find that cHttp component.
Are you sure its available in the Community versions?
I attached my palette images: default, searching for "cHttp", searching for "http".
Where do I have to look?
As comparison I added a shot how it works in the current solution.
Moderator

Re: Read XML Input from URL (instead of File)

Hi,
It is available in talend open studio for ESB, indeed. But they are in "Mediation" section not "Integration".
Best regards
Sabrina
One Star

Re: Read XML Input from URL (instead of File)

Hi,
It is available in talend open studio for ESB, indeed. But they are in "Mediation" section not "Integration".

You are correct.
Found it and starting to experiment with it.
Thanks a lot!
Moderator

Re: Read XML Input from URL (instead of File)

Hi,
For your case, I think tFileFetch and tREST may be an option for you.
Best regards
Sabrina
One Star

Re: Read XML Input from URL (instead of File)

Just a quick check if I got this right:
To use the cHttp component I have to switch to "Mediation" mode.
To write something into SugarCRM (or anywhere else) I have to switch to "Integration" mode.
So.. how Do I connect something I read with the "cHttp" component in a route to a job that writes the output somewhere else?
I found a way to connect a route to a job - but thats where I am stuck now.
Whats the next step from there to achieve data into SugarCRM?
I watched most tutorials I found and read the "basics" - but this connection is still a mystery to me.
How do FileFetch & Rest come into play?
To me they dont seem to be able to read from a (notREST)URL?
One Star

Re: Read XML Input from URL (instead of File)

What I found to be kinda working is:
Create a file within a route.
Create a job with a "tWaitForFile" that reads the file and writes it to SugarCRM.
See screens attached.
But this seems overhead to me - why the need to create a physical file each time?
There has to be a way to put it directly into the database...
Employee

Re: Read XML Input from URL (instead of File)

You can use the cTalendJob component to send the contents over to a Job (under the covers it's just invoking the Job as a Java class). Then when you use tRouteInput in the job, you chose what to read off of the Route Message (a.k.a. Camel Exchange) and read the data you need in as fields. Check out Apache Camel's Simple Expression language to see how to read the data out of the Route (Search for Camel Simple for the Apache documentation).
I hope that helps!