<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Web service : send a csv file in response in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295068#M67887</link>
    <description>Hi, 
&lt;BR /&gt;I have done this :&amp;nbsp; 
&lt;BR /&gt;tRESTRequest--(main)--&amp;gt;tFlowToIterate--(iterate)--tJava--(onComponentOK)--tFixedFlowInput--(main)--tXMLMap--(main)--tRESTResponse 
&lt;BR /&gt;In the tJava, I have hardcoded some lines in order to put the file in a globalMap as a byte array : 
&lt;BR /&gt; 
&lt;I&gt;String filePath = "C:/eula.1036.txt";&lt;/I&gt; 
&lt;BR /&gt; 
&lt;I&gt;byte[] t_byte = (byte[]) routines.SynotisFileUtils.getByteArrayFromFile(filePath);&lt;/I&gt; 
&lt;BR /&gt; 
&lt;I&gt;globalMap.put("mon_fichier", (byte[]) t_byte);&amp;nbsp;&lt;/I&gt; 
&lt;BR /&gt;In the tRESTResponse, I have set the&amp;nbsp;"Content-type" ("text/plain") and the&amp;nbsp;"Content-disposition" ("attachment"). 
&lt;BR /&gt;It seems to work but the file is empty... 
&lt;BR /&gt;Any idea ?</description>
    <pubDate>Wed, 06 Aug 2014 14:29:44 GMT</pubDate>
    <dc:creator>Ahhouais</dc:creator>
    <dc:date>2014-08-06T14:29:44Z</dc:date>
    <item>
      <title>Web service : send a csv file in response</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295067#M67886</link>
      <description>Hi everybody,
&lt;BR /&gt;I would like to design a Web service that can send a user un file (.csv or .txt) containing some rows extracted from a table.
&lt;BR /&gt;I want to call this Web service from a browser and I want to be able to give some parameters in the URL.&amp;nbsp;
&lt;BR /&gt;For instance, I want to send a file&amp;nbsp;containing all the countries with a name starting by a letter.&amp;nbsp;
&lt;BR /&gt;The URL could be &lt;A href="http://localhost:8040/listCountries?letter=F" target="_blank"&gt;http://localhost:8040/listCountries?letter=F&lt;/A&gt;
&lt;BR /&gt;For designing this Web service, which components can I use ?&amp;nbsp;
&lt;BR /&gt;I though to this orchestration :&amp;nbsp;
&lt;BR /&gt;tRESTRequest --tFlowToIterate--tMySQLInput--tXMLMap--tRESTResponse but I have some questions :
&lt;BR /&gt;1) How can I get the parameter 'letter' given in the URL ?&amp;nbsp;
&lt;BR /&gt;2) Once I have executed the request, how can I set the tRESTResponse to send a file ?
&lt;BR /&gt;Any help would be appreciated.
&lt;BR /&gt;Thanks</description>
      <pubDate>Sat, 16 Nov 2024 11:33:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295067#M67886</guid>
      <dc:creator>Ahhouais</dc:creator>
      <dc:date>2024-11-16T11:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Web service : send a csv file in response</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295068#M67887</link>
      <description>Hi, 
&lt;BR /&gt;I have done this :&amp;nbsp; 
&lt;BR /&gt;tRESTRequest--(main)--&amp;gt;tFlowToIterate--(iterate)--tJava--(onComponentOK)--tFixedFlowInput--(main)--tXMLMap--(main)--tRESTResponse 
&lt;BR /&gt;In the tJava, I have hardcoded some lines in order to put the file in a globalMap as a byte array : 
&lt;BR /&gt; 
&lt;I&gt;String filePath = "C:/eula.1036.txt";&lt;/I&gt; 
&lt;BR /&gt; 
&lt;I&gt;byte[] t_byte = (byte[]) routines.SynotisFileUtils.getByteArrayFromFile(filePath);&lt;/I&gt; 
&lt;BR /&gt; 
&lt;I&gt;globalMap.put("mon_fichier", (byte[]) t_byte);&amp;nbsp;&lt;/I&gt; 
&lt;BR /&gt;In the tRESTResponse, I have set the&amp;nbsp;"Content-type" ("text/plain") and the&amp;nbsp;"Content-disposition" ("attachment"). 
&lt;BR /&gt;It seems to work but the file is empty... 
&lt;BR /&gt;Any idea ?</description>
      <pubDate>Wed, 06 Aug 2014 14:29:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295068#M67887</guid>
      <dc:creator>Ahhouais</dc:creator>
      <dc:date>2014-08-06T14:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Web service : send a csv file in response</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295069#M67888</link>
      <description>Any idea ?</description>
      <pubDate>Tue, 12 Aug 2014 15:20:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295069#M67888</guid>
      <dc:creator>Ahhouais</dc:creator>
      <dc:date>2014-08-12T15:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Web service : send a csv file in response</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295070#M67889</link>
      <description>4FMPci  &amp;lt;a href=""&amp;gt;gyzqdbdcujdu&amp;lt;/a&amp;gt;, osbeugmytpcu, fgnyltdbsoen,</description>
      <pubDate>Thu, 04 Sep 2014 04:14:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295070#M67889</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-09-04T04:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Web service : send a csv file in response</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295071#M67890</link>
      <description>Sorry ?&lt;BR /&gt;Still can't send my result in the response...</description>
      <pubDate>Wed, 24 Sep 2014 09:48:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Web-service-send-a-csv-file-in-response/m-p/2295071#M67890</guid>
      <dc:creator>Ahhouais</dc:creator>
      <dc:date>2014-09-24T09:48:18Z</dc:date>
    </item>
  </channel>
</rss>

