<?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: Accessing response headers from tRESTClient (5.6.1) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275835#M52089</link>
    <description>Excellent.. I was coming in to reply that the get headers returns a map that you have to pull the needed values out of..</description>
    <pubDate>Thu, 26 Mar 2015 18:01:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-26T18:01:17Z</dc:date>
    <item>
      <title>Accessing response headers from tRESTClient (5.6.1)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275831#M52085</link>
      <description>First off.. second day using Talend.. &amp;nbsp;very impressed so far.. &amp;nbsp; 
&lt;BR /&gt;I'm trying to access data from a REST API which uses a two call method to get some types of data. 
&lt;BR /&gt;Call 1 is a POST that requests a potentially long running activity. &amp;nbsp;The response to this call is a URL that is used to poll for completion of the call. 
&lt;BR /&gt;Call 2 is a GET that simply uses the URL returned in Call 1. 
&lt;BR /&gt;The issue is that the call back URL is in the response header of call 1. &amp;nbsp;From what i understand the headers are supposed to be put into the globalMap. &amp;nbsp;There is a FLOW tied to the first tRestClient that resolves to "((java.util.Map&amp;lt;String,java.util.List&amp;lt;String&amp;gt;&amp;gt;)globalMap.get("tRESTClient_1_HEADERS"))". &amp;nbsp;Problem is there's nothing in the globalMap by that name so the setting of the URL in call 2 gets a null pointer. &amp;nbsp; 
&lt;BR /&gt;When the job is run with "log messages" checked the expected response headers are dumped out so the data is there. 
&lt;BR /&gt;From what i can tell in the generated code it's not doing anything to put the headers into the globalmap after the call is made. &amp;nbsp;It looks to be making the post call in such a way that it wouldn't have access to the response headers at all. 
&lt;BR /&gt;There are records of this issue being fixed in 5.2. &amp;nbsp;see TESB-8944. 
&lt;BR /&gt;I had started yesterday with the Open source data integration version. &amp;nbsp;tRest in the internet toolset has the same issue. &amp;nbsp;Found discussions regarding tRESTClient in ESB toolset and tried it out in TOS Integration. &amp;nbsp;No joy. &amp;nbsp;Wondered if maybe i needed the ESB version of TOS to make this bit work. &amp;nbsp;So, DL'd the open source ESB TOS and rebuilt the job there.. &amp;nbsp;Same result.. &amp;nbsp;Would this operate differently in the subscribed version of ESB?</description>
      <pubDate>Fri, 06 Feb 2015 01:42:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275831#M52085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-06T01:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing response headers from tRESTClient (5.6.1)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275832#M52086</link>
      <description>Found the issue... &amp;nbsp;The headers are put into the globalMap only if something is being done with the response payload. &amp;nbsp;For the call against this API the response payload is empty so I didn't do anything with it in the designer. &amp;nbsp; This meant the code that pulls the headers wasn't generated.
&lt;BR /&gt;To get around this i send the empty result to a logger and took the flow output to the next tRESTClient via OnComponentOk.</description>
      <pubDate>Mon, 09 Feb 2015 16:33:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275832#M52086</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-09T16:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing response headers from tRESTClient (5.6.1)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275833#M52087</link>
      <description>How did you tie the flow to the first tRestClient to resolve to&amp;nbsp;((java.util.Map&amp;lt;String,java.util.List&amp;lt;String&amp;gt;&amp;gt;)globalMap.get("tRESTClient_1_HEADERS"))? Debugging Java showed that the headers are in the globalMap but I can't access it...</description>
      <pubDate>Thu, 26 Mar 2015 16:07:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275833#M52087</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2015-03-26T16:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing response headers from tRESTClient (5.6.1)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275834#M52088</link>
      <description>Ok, got it 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;used tJavaRow like this 
&lt;BR /&gt;output_row.name = ((java.util.Map&amp;lt;String,java.util.List&amp;lt;String&amp;gt;&amp;gt;)globalMap.get("tRESTClient_1_HEADERS")).get("Set-Cookie").get(1).toString();</description>
      <pubDate>Thu, 26 Mar 2015 17:35:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275834#M52088</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2015-03-26T17:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing response headers from tRESTClient (5.6.1)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275835#M52089</link>
      <description>Excellent.. I was coming in to reply that the get headers returns a map that you have to pull the needed values out of..</description>
      <pubDate>Thu, 26 Mar 2015 18:01:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Accessing-response-headers-from-tRESTClient-5-6-1/m-p/2275835#M52089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-26T18:01:17Z</dc:date>
    </item>
  </channel>
</rss>

