<?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: Get JSON data from REST web service but cannot parse?? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Get-JSON-data-from-REST-web-service-but-cannot-parse/m-p/2317289#M87748</link>
    <description>&lt;P&gt;Was this resolved? I am also facing the same issue. The output from ExtractJSONFields in the body field is an XML as string. How do we map it to a schema. When I tried enforcing schema, I got error. Please help.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2019 22:28:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-06-12T22:28:34Z</dc:date>
    <item>
      <title>Get JSON data from REST web service but cannot parse??</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-JSON-data-from-REST-web-service-but-cannot-parse/m-p/2317287#M87746</link>
      <description>Hello!
&lt;BR /&gt;Am in a terribly sticky situation. What I have is the following setup:
&lt;BR /&gt;tRESTClient --&amp;gt; tExtractJSONFields --&amp;gt; tLogRow
&lt;BR /&gt;Now, if I skip the tExtractJSON fields and put the REST GET results right to the tLogRow, the body Document object data shows up... as a XML file! (This is if I wrap JSON response; if I don't, it shows up as a JSON file.) However, attempting to parse the data into the appropriate fields, the best that I have gotten is a bunch of rows with blank fields, which is not what the web service returns.
&lt;BR /&gt;Here are my settings. I have tried a number of different permutations and these are frankly the best I ever get:
&lt;BR /&gt;
&lt;B&gt;tRESTClient&lt;/B&gt;
&lt;BR /&gt;
&lt;BR /&gt;HTTP Method: GET
&lt;BR /&gt;Type: JSON
&lt;BR /&gt;Convert Response to DOM Document: True
&lt;BR /&gt;Wrap JSON Response: True
&lt;BR /&gt;Schema:
&lt;BR /&gt;
&lt;BR /&gt;statusCode (Integer)
&lt;BR /&gt;body (Document)
&lt;BR /&gt;string (String 4048)
&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;tExtractJSONFields&lt;/B&gt;
&lt;BR /&gt;
&lt;BR /&gt;Read By: Xpath
&lt;BR /&gt;Champ JSON: body
&lt;BR /&gt;XPath Query Loop: "/root/products"
&lt;BR /&gt;Mapping:
&lt;BR /&gt;
&lt;BR /&gt;id : "/id"
&lt;BR /&gt;code : "/code"
&lt;BR /&gt;provider : "/provider"
&lt;BR /&gt;type : "/type"
&lt;BR /&gt;label : "/label"
&lt;BR /&gt;currency : "/currency"
&lt;BR /&gt;
&lt;BR /&gt;And here is my data:
&lt;BR /&gt;
&lt;B&gt;Document object string (if I don't convert to DOM):&lt;/B&gt;
&lt;BR /&gt;
&lt;BR /&gt;{"products": }
&lt;BR /&gt;(Please note there are no breaks or spaces between items in the actual object; I have included them here for your eyes.)
&lt;BR /&gt;
&lt;B&gt;Document object body&amp;nbsp;(if I convert to DOM):&lt;/B&gt;
&lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&lt;BR /&gt;&amp;lt;root&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;products&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;id&amp;gt;11111&amp;lt;/id&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;code&amp;gt;AAA&amp;lt;/code&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;provider&amp;gt;BBB&amp;lt;/provider&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;type&amp;gt;CCC&amp;lt;/type&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;label&amp;gt;DDD&amp;lt;/label&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;currency&amp;gt;EEE&amp;lt;/currency&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/products&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;products&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;id&amp;gt;22222&amp;lt;/id&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;code&amp;gt;FFF&amp;lt;/code&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;provider&amp;gt;GGG&amp;lt;/provider&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;type&amp;gt;HHH&amp;lt;/type&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;label&amp;gt;III&amp;lt;/label&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;currency&amp;gt;JJJ&amp;lt;/currency&amp;gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/products&amp;gt;
&lt;BR /&gt;&amp;lt;/root&amp;gt;
&lt;BR /&gt;(Please note there are no breaks or spaces between items in the actual object; I have included them here for your eyes.)
&lt;BR /&gt;
&lt;B&gt;tLogRow output with settings above:&lt;/B&gt;
&lt;BR /&gt;id code provider type label currency
&lt;BR /&gt;|||||
&lt;BR /&gt;|||||
&lt;BR /&gt;Any ideas?? I'm going crazy!
&lt;BR /&gt;Many thanks and have a nice weekend anyhow!
&lt;BR /&gt;Cheers,
&lt;BR /&gt;Nico</description>
      <pubDate>Sat, 16 Nov 2024 11:09:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-JSON-data-from-REST-web-service-but-cannot-parse/m-p/2317287#M87746</guid>
      <dc:creator>nmoses</dc:creator>
      <dc:date>2024-11-16T11:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get JSON data from REST web service but cannot parse??</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-JSON-data-from-REST-web-service-but-cannot-parse/m-p/2317288#M87747</link>
      <description>I would make sure that the tLogRow has the proper schema mapping. &amp;nbsp;In theory, the tlogRow should the raw string of whatever is inside the trestclient column ...&amp;nbsp;&lt;BR /&gt;are you just trying to read the fields? &amp;nbsp;it seems you are able to read the JSON object contents.</description>
      <pubDate>Fri, 26 Jun 2015 23:52:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-JSON-data-from-REST-web-service-but-cannot-parse/m-p/2317288#M87747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-26T23:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get JSON data from REST web service but cannot parse??</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-JSON-data-from-REST-web-service-but-cannot-parse/m-p/2317289#M87748</link>
      <description>&lt;P&gt;Was this resolved? I am also facing the same issue. The output from ExtractJSONFields in the body field is an XML as string. How do we map it to a schema. When I tried enforcing schema, I got error. Please help.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 22:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-JSON-data-from-REST-web-service-but-cannot-parse/m-p/2317289#M87748</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-12T22:28:34Z</dc:date>
    </item>
  </channel>
</rss>

