retrieve XML from API REST

One Star

retrieve XML from API REST

Hi all,
I am new in Talend community. I have read the user guide and some tutorial. But I have some difficulty to solve my problem.
I must retrieve a XML file from WEB Rest Service. I had looked the componant tWebService but i can't call the web service because it's not deploy yet ... .
So I want to create job or create a new compenant which :
- Get XML file in entry.
- Check the XML file with XSD schema from the web Service (i can't call the web service but y have the XSD schema).
- Retrieve attributs.
- Store attributs in SGBD.

It's not realy complex in fact.But the main purpose is my XML file use Inheritance, and i don't how to manage it on TALEND, can we ?
For the moment I don't have find any method. I had tried to create metadata XML file with the XSD but i didn't success.
Maybe i think so much in JAVA. I want control everything at low lvl. It's strange to think at an upper lvl of interaction...
Here a sample XML:
<?xml version="1.0" encoding="UTF-8"?>
<MyCustomer xmlns:xsi="" xsi:type="CustomerBasic" id="1" />
<MyCustomer xmlns:xsi="" xsi:type="CustomerPremium" id="2">

Here a XSD sample:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="" >
<!-- defini an abstract Customer -->
<xsd:complexType name="AbstractCustomer" abstract="true" >
<xsd:attribute name="id" type="xsd:string"/>
<xsd:attribute name="firstname" type="xsd:string"/>
<xsd:attribute name="lastename" type="xsd:string"/>

<xsd:complexType name="CustomerBasic">
<xsd:extension base="AbstractCustomer">


<xsd:complexType name="CustomerPremium">
<xsd:complexContent >
<xsd:extension base="AbstractCustomer">
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element name="credits" type="xsd:string"/>

<xsd:element name="Customers">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="MyCustomer" type="AbstractCustomer"/>


Valid by site

If we can't use Inheritance, we have to create one job that check the xsi:type for each MyCustomer, and
create different process for each class which extend MyCustomer. Because in my SGBD I have to create
three tables in order to store my customers. One AbstractCustomer which have the id share(because of the integrity constraint) for tables CustomerBasic
and CustomerPremium . What do you think ?

Do you have any idea ?

Thank in advance,
One Star

Re: retrieve XML from API REST

Is the return result of this web service is a XML file?
Or you want to get a XML respone?
1. Use tSOAP to get XML response.
2. Use tXSDValidator to validate XML file.
3. tFileInputXML to retrieve data.
One Star

Re: retrieve XML from API REST

Yes the result is in XML.
Thank for give me a way to manage it, I will try your solution.


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables


Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables


Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema