Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

 

 

Labels (7)
6 Replies
Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

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. 

0683p000009M0Re.png

 

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

Thanks, this solution is working for me.

 

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

Anonymous
Not applicable
Author

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 🙂

kramaswamy1695221616
Contributor
Contributor

Second is that your XML has a looping section that will loop per row fed into it?

How do i configure this?@rhall