Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

Posting entire JSON data (all rows in single call) using tRestClient

Highlighted
Four Stars

Posting entire JSON data (all rows in single call) using tRestClient

I am trying to post the CSV file data to TRestClient in json format.

I am able to post the data to Rest service using TXML map, but it is working only for one row (i.e, if have 100 records in my csv then rest service is being called 100 times by TRestClient).

 

I need to pass the entire data in one single call to rest service. I have attached the screenshot of the job that I have made.

 

I would really appreciate any help in this regard.

 

 

Highlighted
Community Manager

Re: Posting entire JSON data (all rows in single call) using tRestClient

I am making some assumptions here. First that your XML is configured correctly in the tXMLMap. The second is that your XML has a looping section that will loop per row fed into it. If this is the case, you need to click on the spanner in the tXMLMap output table and set "Allin one" to true. This will produce one XML document and send it to your tRestClient.

Highlighted
Four Stars

Re: Posting entire JSON data (all rows in single call) using tRestClient

I have csv file in input and parsing the data in xml using TXmlMap.

Please tell me, From where i can set 'Allin true' options from the following screen.

I am new in talend. 

TXmlMap.png

 

Highlighted
Community Manager

Re: Posting entire JSON data (all rows in single call) using tRestClient

You need to click the spanner symbol in the yellow block where your "aa" output schema is. However, I can see that your XML schema is not configured at all. I sense you have quite a few more hurdles here. You need to create your XML schema and assign your looping element.

Highlighted
Four Stars

Re: Posting entire JSON data (all rows in single call) using tRestClient

Thanks, this solution is working for me.

 

One more question, can we pass JSON list to TRestClient?

Highlighted
Community Manager

Re: Posting entire JSON data (all rows in single call) using tRestClient

Yes JSON can be passed to a tRestClient. You have to remember that JSON is a String and not a Document. That is the mistake that most people make when trying to use JSON. Would you mind accepting the post that pointed you in the right direction as the solution to this please? It helps point people also struggling with the same issue, in the right direction. Thanks :-)

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Talend Cloud Available on Microsoft Azure

An integration platform-as-a-serviceto help enterprises collect, govern, transform, and share data from any data sources

Watch Now

Self-service Talend Migration: Moving from On-Premises to the Cloud

Move from On-Premises to the Cloud by following the advice of experts

Read Now

How to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud reg...

Learn how to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud registries

Blog