<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>etl Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/etl/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/etl/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Mon, 05 Aug 2024 17:37:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>etl Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/etl/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Read / Write REST API data in Talend (JSON / XML / SOAP)</title>
		<link>https://zappysys.com/blog/read-write-rest-api-data-in-talend-json-xml-soap/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 12 Jan 2019 20:18:31 +0000</pubDate>
				<category><![CDATA[ETL - Talend]]></category>
		<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC Gateway]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[etl]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[talend]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6012</guid>

					<description><![CDATA[<p>Introduction In this post we will learn how to read / write REST API data in Talend Open Studio. We will create a simple Talend Job using ZappySys JSON  Driver to read from REST API / JSON Files and load into Target (e.g. File / DB). Techniques listed in this article can be also used to [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-write-rest-api-data-in-talend-json-xml-soap/">Read / Write REST API data in Talend (JSON / XML / SOAP)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff7b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>UPDATE:</strong> Please visit <a href="https://zappysys.com/api/integration-hub/apps/talend-studio">Talend Studio Connectors</a> page in <a href="https://zappysys.com/api/integration-hub">API Integration Hub</a> to find updated articles on various Talend Studio integrations, including integrations with <a href="https://zappysys.com/api/integration-hub/rest-api-connector/talend-studio">REST API</a>, <a href="https://zappysys.com/api/integration-hub/soap-connector/talend-studio">SOAP API</a>, <a href="https://zappysys.com/api/integration-hub/json-file-connector/talend-studio">JSON file</a>, and <a href="https://zappysys.com/api/integration-hub/xml-file-connector/talend-studio">XML file</a>.</div></div>
<p><img decoding="async" class="wp-image-11136 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-logo-2.png" alt="" width="150" height="151" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-logo-2.png 177w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-logo-2-150x150.png 150w" sizes="(max-width: 150px) 100vw, 150px" />In this post we will learn how to read / write REST API data in Talend Open Studio. We will create a simple Talend Job using <a href="https://zappysys.com/products/odbc-powerpack/odbc-json-rest-api-driver/" target="_blank" rel="noopener">ZappySys JSON  Driver</a> to read from REST API / JSON Files and load into Target (e.g. File / DB). Techniques listed in this article can be also used to read from SOAP API / XML Files or CSV Files / API using <a href="https://zappysys.com/products/odbc-powerpack/odbc-xml-soap-api-driver/">XML Driver</a> / <a href="https://zappysys.com/products/odbc-powerpack/odbc-csv-rest-api-driver/">CSV Driver</a>.</p>
<p>These drivers support familiar SQL query language. Using SQL you can query virtually any API services just like relational database table. It can flatten nested hierarchy and provide output in rows / columns. Many complex REST API / SOAP API complexity is taken care automatically (e.g. Authentication, Pagination, Security, Error Handling).</p>
<p>So let&#8217;s get started.</p>
<p>&nbsp;</p>
<h2>Requirements</h2>
<ol>
<li>Download and install Talend Open Studio (FREE) <a href="https://www.talend.com/products/data-integration/data-integration-open-studio/" target="_blank" rel="noopener">from here</a>. Skip this step if you already installed.</li>
<li>Download <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> (JSON / XML Drivers)</li>
<li>Get Microsoft <strong>JDBC driver</strong> for <strong>SQL Server</strong> <a href="https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=11774">from here</a> (Download <strong>sqljdbc_6.0.8112.200_enu.exe</strong> which is self extracting file you can run and extract to some folder)<br />
After you extract jdbc files, go to sqljdbc_6.0\enu\jre8\ folder rename <strong>sqljdbc42.jar</strong> to  <strong>mssql-jdbc.jar</strong> (name must be this). We will load this file in Talend later in this article.</li>
<li>Basic knowledge about REST API and JSON / XML format.</li>
</ol>
<h2>Configure Data Gateway</h2>
<div class="content_block" id="custom_post_widget-5282">Now let's look at how to configure <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a>. This feature acts as a bridge between Client App and ZappySys Drivers. Using data gateway you can use ZappySys Drivers inside applications / operating systems where ZappySys drivers may not be available directly for some reason (e.g. You don't have access to Server for Installation or System does not support ODBC drivers like JAVA programs). <a href="https://zappysys.com/blog/category/odbc-powerpack/odbc-gateway/">Click here to read more</a> on various use cases of Data Gateway.
<h4><span style="font-size: 14pt;">Configure Data Gateway User / Port</span></h4>
Now let's look at steps to configure Data Gateway after installation. We will also create a sample data source for ODATA API (i.e. JSON based REST API Service).
<ol>
 	<li>Assuming you have installed <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> using default options (Which also enables Data Gateway Service)</li>
 	<li>Search "Gateway" in your start menu and click ZappySys Data Gateway
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png" alt="Open ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Open ZappySys Data Gateway</p>

</div></li>
 	<li>First make sure Gateway Service is running (Verify Start icon is disabled)</li>
 	<li>Also verify Port on General Tab
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-1.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-1.png" alt="Port Number setting on ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Port Number setting on ZappySys Data Gateway</p>

</div></li>
 	<li>Now go to Users tab. <strong>Click Add</strong> icon to add a new user. Check Is admin to give access to all data sources you add in future. If you don't check admin then you have to manually configure user permission for each data source.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-2.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-2.png" alt="Add Data Gateway User" /></a>
<p class="wp-caption-text">Add Data Gateway User</p>

</div></li>
</ol>
&nbsp;
<h4><span style="font-size: 14pt;">Configure Data Source</span></h4>
<ol>
 	<li>After user is added, go to Data Sources tab. <strong>Click Add</strong> icon to create new data source. Select appropriate driver based on your API / File format. You can choose Generic ODBC option to read data from ODBC DSN or use Native Driver option.
<pre class=""><strong>NOTE:</strong> Whenever possible use native driver option for better performance / security and ease of use.</pre>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-3.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-3.png" alt="Add Gateway Data Source (Native JSON Driver)" /></a>
<p class="wp-caption-text">Add Gateway Data Source (Native JSON Driver)</p>

</div></li>
 	<li>Click on "Edit" under Data source and configure as per your need (e.g. Url, Connection, Request Method, Content Type, Body, Pagination etc.). For this demo we are going to pick simple JSON REST API which doesn't need any authentication.  Enter following URL.
<pre class="">https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json</pre>
</li>
 	<li>You can also view response structure and select default hierarchy (i.e. Filter) like below (Select Array Icon) for data extraction.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-4.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-4.png" alt="Configure JSON API Data source" /></a>
<p class="wp-caption-text">Configure JSON API Data source</p>

</div></li>
</ol>
<h4><span style="font-size: 14pt;">Test SQL Query / Preview Data</span></h4>
<ol>
 	<li>Now go to Preview Tab. You can click Preview button to execute default query
OR
Select Table name from dropdown to generate SQL with column names.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-5.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-5.png" alt="JSON / REST API Driver Query Preview / Query Examples (Read REST API or JSON Files)" /></a>
<p class="wp-caption-text">JSON / REST API Driver Query Preview / Query Examples (Read REST API or JSON Files)</p>

</div></li>
 	<li>You can also click Query Builder to generate SQL using different options in WITH clause. ANy setting you specify in WITH clause will override UI settings we applied in previous steps.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-6.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-6.png" alt="Using SQL Query Builder (For Files or REST / SOAP API - JSON / XML / CSV Format)" /></a>
<p class="wp-caption-text">Using SQL Query Builder (For Files or REST / SOAP API - JSON / XML / CSV Format)</p>

</div></li>
 	<li>There is another useful option for code generation. Select your Language and quickly copy code snippet. See below Example of XML Driver Query to call SOAP API.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-7.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-7.png" alt="Generate Example Code for ZappySys Driver" /></a>
<p class="wp-caption-text">Generate Example Code for ZappySys Driver</p>

</div></li>
 	<li><strong>Click OK</strong> to Close Data Source UI</li>
 	<li>Once data source is tested and configured you can <strong>click Save </strong>button in the Gateway UI toolbar and click <strong>Yes</strong> for <strong>Restart Service</strong>.</li>
</ol>
&nbsp;</div>
<h2>Register MS SQL JDBC driver in Talend</h2>
<p>Now lets register Microsoft JDBC Driver in Talend. This is very important step because MSSQL JDBC driver is used to communicate with ZappySys Data Gateway we configured in previous step.</p>
<p>If you missed steps mentioned in the Requirements section then make sure you first download JDBC driver using below steps.</p>
<p>Get Microsoft <strong>JDBC driver</strong> for <strong>SQL Server</strong> <a href="https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=11774">from here</a> (Download <strong>sqljdbc_6.0.8112.200_enu.exe</strong> which is self extracting file you can run and extract to some folder). After you extract jdbc files, go to sqljdbc_6.0\enu\jre8\ folder rename <strong>sqljdbc42.jar</strong> to  <strong>mssql-jdbc.jar</strong> (name must be this).</p>
<p>Now lets go through the steps to register MSSQL jdbc driver in Talend.</p>
<ol>
<li>Open Talend Open Studio</li>
<li>Go to <strong>Windows</strong> &gt; Click <strong><strong>Show View</strong></strong>
<div id="attachment_6038" style="width: 456px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-show-views-menu.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-6038" class="size-full wp-image-6038" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-show-views-menu.png" alt="Talend - Show View" width="446" height="184" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-show-views-menu.png 446w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-show-views-menu-300x124.png 300w" sizes="(max-width: 446px) 100vw, 446px" /></a><p id="caption-attachment-6038" class="wp-caption-text">Talend &#8211; Show View</p></div></li>
<li>When you see Popup selection under <strong>Talend</strong> &gt; Select <strong><strong><strong>Modules</strong></strong></strong>
<div id="attachment_6037" style="width: 342px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-show-modules-option.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6037" class="size-full wp-image-6037" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-show-modules-option.png" alt="Talend - Select Modules Window" width="332" height="399" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-show-modules-option.png 332w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-show-modules-option-250x300.png 250w" sizes="(max-width: 332px) 100vw, 332px" /></a><p id="caption-attachment-6037" class="wp-caption-text">Talend &#8211; Select Modules Window</p></div></li>
<li>When Module window is visible click on Little Jar Icon (Bottle icon) in the toolbar.</li>
<li>Select <strong>mssql-jdbc.jar</strong> file we renamed earlier and load this file.
<div id="attachment_6036" style="width: 870px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-register-jdbc-driver-import-mssql-jar.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6036" class="size-full wp-image-6036" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-register-jdbc-driver-import-mssql-jar.png" alt="Talend - Import JAR file / module (Register MS SQL JDBC Driver Example)" width="860" height="348" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-register-jdbc-driver-import-mssql-jar.png 860w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-register-jdbc-driver-import-mssql-jar-300x121.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-register-jdbc-driver-import-mssql-jar-768x311.png 768w" sizes="(max-width: 860px) 100vw, 860px" /></a><p id="caption-attachment-6036" class="wp-caption-text">Talend &#8211; Import JAR file / module (Register MS SQL JDBC Driver Example)</p></div></li>
<li>That&#8217;s it. Now we ready to make API calls / read from JSON / XML in the next section.</li>
</ol>
<h2>Setup Talend REST API Connection (JSON / XML / CSV)</h2>
<p>Now let&#8217;s configure REST API Connection in Talend. To read from JSON / XML Files you can use same steps too. We will use MSSQL JDBC Driver to connect to ZappySys Data Gateway.</p>
<ol>
<li>In Talend Go to Metadata &gt; Db Connections (Right click) &gt; Create Connection
<div id="attachment_6030" style="width: 353px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-create-new-db-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6030" class="size-full wp-image-6030" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-create-new-db-connection.png" alt="Talend - Create new DB connection (JSON / REST API Example)" width="343" height="364" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-create-new-db-connection.png 343w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-create-new-db-connection-283x300.png 283w" sizes="(max-width: 343px) 100vw, 343px" /></a><p id="caption-attachment-6030" class="wp-caption-text">Talend &#8211; Create new DB connection (JSON / REST API Example)</p></div></li>
<li>On the connection Wizard specify following attributes.<br />
<strong>DB Version :</strong> Microsoft<br />
<strong>Login :</strong>  username you setup in zappysys data gateway<br />
<strong>Password :</strong>  password of data gateway user<br />
<strong>Server :</strong> machine name or IP where zappysys data gateway is running<br />
<strong>Port :</strong> &lt;default is 5000&gt; Port on which zappysys data gateway is listening<br />
<strong>DataBase :</strong>  Data source name you setup in zappysys data gateway (case-sensitive)</p>
<div id="attachment_6029" style="width: 977px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-connect-json-xml-rest-api-using-zappysys-gateway-ms-jdbc.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6029" class="size-full wp-image-6029" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-connect-json-xml-rest-api-using-zappysys-gateway-ms-jdbc.png" alt="Talend - Connect to JSON / REST API using ZappySys Gateway (Use MS SQL JDBC Driver)" width="967" height="716" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-connect-json-xml-rest-api-using-zappysys-gateway-ms-jdbc.png 967w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-connect-json-xml-rest-api-using-zappysys-gateway-ms-jdbc-300x222.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-connect-json-xml-rest-api-using-zappysys-gateway-ms-jdbc-768x569.png 768w" sizes="(max-width: 967px) 100vw, 967px" /></a><p id="caption-attachment-6029" class="wp-caption-text">Talend &#8211; Connect to JSON / REST API using ZappySys Gateway (Use MS SQL JDBC Driver)</p></div></li>
<li>That&#8217;s all we need to do to setup a connection which can be used to read / write REST API data in Talend. In the next section we will see how to create a job to read data from REST API Service using this connection.</li>
</ol>
<p>&nbsp;</p>
<h2>Read from REST API in Talend</h2>
<p>Now let&#8217;s look at how to read data from REST API source or JSON / XML File using the connection we configured in the previous section.</p>
<h3>Configure REST API Source</h3>
<ol>
<li>Create a Talend JOB and double click to open designer</li>
<li>Now drag and drop MSSQL Connection we created for ZappySys Data gateway, drop it on the designer surface. It will popup UI like below.</li>
<li>Select <strong>tDBInput</strong> (Microsoft SQL Server). Remember that we are using MSSQL JDBC Driver to connect to ZappySys Data Gateway for REST API Call. This gateway uses Microsoft TDS Protocol so MSSQL JDBC driver is used to communicate.</li>
<li>Now rename Source to something meaningful (e.g. Read from JSON REST API)</li>
<li>Double click REST Source to configure.</li>
<li>Enter <strong>Query</strong> like below (Make sure to <strong>enter between double quotes</strong>). See below examples to read from URL or File. If you have double quote in SQL then escape using \&#8221; character (e.g. select \&#8221;my col\&#8221; from $ )<strong>Read From REST API Url</strong><br />
<pre class="crayon-plain-tag">"SELECT * FROM value 
WITH (SRC='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json')"</pre>
<strong>Read from Local File (Wildcard Pattern Search allowed)</strong><br />
<pre class="crayon-plain-tag">"SELECT * FROM value 
WITH (SRC='c:\data\Customers_*.json')"</pre>
</li>
<li>Click on <strong>Guess Schema</strong> button and Click OK to accept detected schema.
<div id="attachment_6028" style="width: 972px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-configure-json-rest-api-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6028" class="size-full wp-image-6028" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-configure-json-rest-api-source.png" alt="Talend - Configure REST API / JSON Source (Enter SQL Query / Guess Schema)" width="962" height="723" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-configure-json-rest-api-source.png 962w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-configure-json-rest-api-source-300x225.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-configure-json-rest-api-source-768x577.png 768w" sizes="(max-width: 962px) 100vw, 962px" /></a><p id="caption-attachment-6028" class="wp-caption-text">Talend &#8211; Configure REST API / JSON Source (Enter SQL Query / Guess Schema)</p></div></li>
<li>Now we will configure target in the next section.</li>
</ol>
<h3>Configure Target (Delimited File)</h3>
<ol>
<li>Now search for &#8220;FileOut&#8221; in the toolbox (Hit Enter). You will see <strong>tFileOutputDelimited</strong> so just select that for now and drag on the surface.
<div id="attachment_6035" style="width: 828px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-to-csv-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6035" class="size-full wp-image-6035" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-to-csv-file.png" alt="Talend - Add File Output (tFileOutputDelimited)" width="818" height="307" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-to-csv-file.png 818w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-to-csv-file-300x113.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-to-csv-file-768x288.png 768w" sizes="(max-width: 818px) 100vw, 818px" /></a><p id="caption-attachment-6035" class="wp-caption-text">Talend &#8211; Add File Output (tFileOutputDelimited)</p></div></li>
<li>Double click it to configure.</li>
<li>Enter correct file path (e.g. &#8220;C:/Talend/workspace/rest-api-output.csv&#8221; )</li>
<li>On Advanced Tab you can configure some additional settings (e.g. Throw an error if file already exists)</li>
</ol>
<h3>Connect and Run</h3>
<ol>
<li>Once you have configured Source and Target its time to connect them</li>
<li>Drag Source Port to Target to connect like below.
<div id="attachment_6033" style="width: 539px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-load-json-rest-api-data-to-csv-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6033" class="size-full wp-image-6033" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-load-json-rest-api-data-to-csv-file.png" alt="Talend - Connect REST / JSON Source to File Target" width="529" height="176" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-load-json-rest-api-data-to-csv-file.png 529w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-load-json-rest-api-data-to-csv-file-300x100.png 300w" sizes="(max-width: 529px) 100vw, 529px" /></a><p id="caption-attachment-6033" class="wp-caption-text">Talend &#8211; Connect REST / JSON Source to File Target</p></div></li>
<li>Run the job
<div id="attachment_6034" style="width: 863px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-rest-api-import-into-file-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6034" class="wp-image-6034 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-rest-api-import-into-file-table.png" alt="Run Talend Job - Loading REST API data into File (Read JSON / XML / CSV)" width="853" height="510" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-rest-api-import-into-file-table.png 853w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-rest-api-import-into-file-table-300x179.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-read-json-rest-api-import-into-file-table-768x459.png 768w" sizes="(max-width: 853px) 100vw, 853px" /></a><p id="caption-attachment-6034" class="wp-caption-text">Run Talend Job &#8211; Loading REST API data into File (Read JSON / XML / CSV)</p></div></li>
<li>That&#8217;s it. So in few clicks you loaded data from REST API to File in Talend Open Studio.</li>
</ol>
<h2>Write / Send data to REST API (POST Example)</h2>
<p>There will be a time when you want to POST data to REST API service. Let&#8217;s check how to write POST query to submit data to REST API.</p>
<p>Just like how we did Read query in previous example, we can set POST Body in the SQL Query to send data. Use query like below and click Guess Schema button. If Blank Filter gives you no data error then make sure you remove Filter on Data Gateway Data source. (Notice we used \&#8221; to escape double quote inside query )</p><pre class="crayon-plain-tag">"SELECT * FROM _root_
WITH (
 METHOD='POST'
,HEADER='Content-Type: text/plain || first-header: AAA || second-header: BBB'
,SRC='http://httpbin.org/post'
,BODY='{id:1,notes:\"Some notes\"}'
,FILTER=''
)
"</pre><p>
<div id="attachment_6040" style="width: 848px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-post-data-to-rest-api-url.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6040" class="size-full wp-image-6040" src="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-post-data-to-rest-api-url.png" alt="Talend - POST data to REST API URL" width="838" height="641" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/talend-post-data-to-rest-api-url.png 838w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-post-data-to-rest-api-url-300x229.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/talend-post-data-to-rest-api-url-768x587.png 768w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-6040" class="wp-caption-text">Talend &#8211; POST data to REST API URL</p></div>
<h2>SQL Query Examples</h2>
<p>Click on below link to learn more writing SQL Query using ZappySys Drivers.</p>
<p><a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">JSON / REST Driver &#8211; SQL Query Examples</a></p>
<p><a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/xml-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">XML / SOAP Driver &#8211; SQL Query Examples</a></p>
<p><a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/csv-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">CSV / REST Driver &#8211; SQL Query Examples</a></p>
<h2>REST API / XML SOAP Pagination Settings for Talend</h2>
<div class="content_block" id="custom_post_widget-3892"><div style="margin-bottom: 1em;">Even we set up ODBC Data Source to get the data, it may not be enough. Usually, if you are getting a huge data set from API provider, it won't give it to you in one HTTP response. Instead, it gives back only a subset of data and provides a mechanism for data pagination. The good news is that <em>ZappySys ODBC Driver</em> includes many options to cover virtually any pagination method.</div>
<div><span style="font-size: 16px;">Below you will find a few examples of API pagination. If you need something more sophisticated check the below link (the article was written for SSIS PowerPack but UI options and concepts apply to ODBC Driver too):</span></div>
<div style="margin-bottom: 1em;"><a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/</a></div>
<h3>Paginate by Response Attribute</h3>
This example shows how to paginate API calls where you need to paginate until the last page detected. In this example, next page is indicated by some attribute called nextlink (found in response). If this attribute is missing or null then it stops fetching the next page.
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH(
SRC=@'https://zappysys.com/downloads/files/test/pagination_nextlink_inarray_1.json'
,NextUrlAttributeOrExpr = '$.nextlink'  --keep reading until this attribute is missing. If attribute name contains dot then use brackets like this $.['my.attr.name']
)</pre>
<h3>Paginate by URL Parameter (Loop until certain StatusCode)</h3>
This example shows how to paginate API calls where you need to pass page number via URL. The driver keeps incrementing page number and calls next URL until the last page detected (401 error). There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/page-xml.aspx?page=1&amp;mode=DetectBasedOnResponseStatusCode'
,PagingMode='ByUrlParameter'
,PagingByUrlAttributeName='page'
,PagingByUrlEndStrategy='DetectBasedOnResponseStatusCode'
,PagingByUrlCheckResponseStatusCode=401
,IncrementBy=1
)</pre>
<h3>Paginate by URL Path (Loop until no record)</h3>
This example shows how to paginate API calls where you need to pass page number via URL Path. The driver keeps incrementing page number and calls next URL until the last page is detected. There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/cust-&lt;%page%&gt;.xml'
,PagingMode='ByUrlPath'
,PagingByUrlAttributeName='&lt;%page%&gt;'
,PagingByUrlEndStrategy='DetectBasedOnRecordCount'
,IncrementBy=1
)</pre>
<h3>Paginate by Header Link (RFC 5988)</h3>
API like GitHub / Wordpress use Next link in Headers (<a href="https://tools.ietf.org/html/rfc5988" target="_blank" rel="noopener">RFC 5988</a>)
<pre class="lang:default decode:true ">SELECT * FROM $
LIMIT 25
WITH(
	 Src='https://wordpress.org/news/wp-json/wp/v2/categories?per_page=10'
	,PagingMode='ByResponseHeaderRfc5988'
	,WaitTimeMs='200' --//wait 200 ms after each request
)</pre>
&nbsp;</div>
<h2>REST API / SOAP Web Service Connection Settings for Talend</h2>
<div class="content_block" id="custom_post_widget-3896"><div style="margin-bottom: 1em;">If you need to authenticate or authorize your user to access a web resource, you will need to use one of the <em>Connections:</em></div>
<ul>
 	<li>HTTP</li>
 	<li>OAuth</li>
</ul>
<img loading="lazy" decoding="async" class="wp-image-4078 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png" alt="ZappySys XML Driver - HTTP and OAuth Connection Types" width="577" height="302" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png 577w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252-300x157.png 300w" sizes="(max-width: 577px) 100vw, 577px" />
<h3>HTTP Connection</h3>
<div style="margin-bottom: 1em;">Use <em>HTTP Connection</em> for simple Windows, Basic, NTLM or Kerberos authentication. Just fill in a username and a password and you are good to go!</div>
<div style="margin-bottom: 1em;">You can also use <em>HTTP Connection</em> for more sophisticated authentication like:</div>
<ul>
 	<li><strong>SOAP WSS</strong> (when accessing a SOAP WebService)</li>
 	<li><strong>Static Token / API Key</strong> (when need to pass an API key in HTTP header)</li>
 	<li><strong>Dynamic Token</strong> (same as Static Token method except that each time you need to log in and retrieve a fresh API key)</li>
 	<li><strong>JWT Token</strong> (As per RFC 7519)</li>
</ul>
<img loading="lazy" decoding="async" class="alignnone wp-image-4091 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-1.png" alt="" width="622" height="570" />
<h3>OAuth</h3>
If you are trying to access REST API resource, it is a huge chance, you will need to use <em>OAuth Connection</em>. <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">Read this article</a> to understand how OAuth authentication and authorization works and how to use it (article originally was written for <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>, but the concepts and UI stay the same): <br/>
<a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/</a>
<img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-2.png" width="721" height="708" /></div>
<h2>Other settings for REST API / SOAP XML Call in Talend</h2>
<div class="content_block" id="custom_post_widget-3901">There are few settings you can coder while calling Web API
<h3><strong>API Limit / Throttling</strong></h3>
While calling public API or other external web services one important aspect you have to check,  how many requests are allowed by your API. Especially when you use API pagination options to pull many records you have to slow down based on API limits. For example, your API may allow you only 5 requests per second. Use Throttling Tab on Driver UI to set delay after each request.
<h3><strong>2D Array Transformation</strong></h3>
If you are using JSON or XML API Driver then possible you may have to transform your data using 2D array transformation feature. <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">Check this link</a> for more information.

&nbsp;</div>
<h2>REST API / XML SOAP Performance Tips for Talend</h2>
<div class="content_block" id="custom_post_widget-4455">While calling APIs you may face some performance issues. There are a few tips you can consider to speed up things.
<h4><span style="font-size: 14pt;"><strong>Use Server-side filtering if possible in URL or Body Parameters</strong></span></h4>
Many API supports filtering your data by URL parameters or via Body. Whenever possible try to use such features.  Here is an example of <a href="http://www.odata.org/getting-started/basic-tutorial/" target="_blank" rel="noopener">odata API</a>, In the below query the first query is faster than the second query because in the first query we filter at the server.
<pre class="lang:tsql decode:true">SELECT * FROM value
WITH(
	 Src='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json&amp;$filter=Country eq ''USA'''
	,DataFormat='Odata'
)

-- Slow query - Client-side filtering
SELECT * FROM value
WHERE Country ='USA'
WITH(
	 Src='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json'
	,DataFormat='Odata'
)</pre>
<h4><span style="font-size: 14pt;"><strong>Avoid Special features in SQL Query (e.g. WHERE, Group By, Order By)</strong></span></h4>
ZappySys API engine triggers client-side processing if special features are used in Query. Following SQL Features will trigger Client-Side processing which is several times slower than server-side processing. So always try to use simple query (Select col1, col2 .... from mytable )
<ul>
 	<li>WHERE Clause</li>
 	<li>GROUP BY Clause</li>
 	<li>HAVING Clause</li>
 	<li>ORDER BY</li>
 	<li>FUNCTIONS (e.g. Math, String, DateTime, Regex... )</li>
</ul>
LIMIT clause does not trigger client-side processing.
<h4><span style="font-size: 14pt;"><strong>Consider using pre-generated Metadata / Cache File</strong></span></h4>
Use META option in WITH Clause to use static metadata (Pre-Generated)There are two more options to speedup query processing time. Check <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">this article</a> for details.
<ol>
 	<li>
<pre class="lang:default decode:true">select * from value WITH( meta='c:\temp\meta.txt' )
--OR--
select * from value WITH( meta='my-meta-name' )
--OR--
select * from value WITH( meta='[ {"Name": "col1",&amp;nbsp;"Type": "String", Length: 100},&amp;nbsp;{"Name": "col2",&amp;nbsp;"Type": "Int32"} ...... ]' )</pre>
</li>
 	<li>Enable Data Caching Options (Found on <strong>Property Grid</strong> &gt; <strong>Advanced</strong> Mode Only )</li>
</ol>
<h4><span style="font-size: 14pt;"><strong>Consider using Metadata / Data Caching Option</strong></span></h4>
ZappySys API drivers support Caching Metadata and Data rows to speed up query processing. If your data doesn't change often then you can enable this option to speed up processing significantly.

Check <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">this article</a> for details how to enable Data cache / metadata cache feature for datasource level or query level.

To define cache option at query level you can use like below.
<pre class="">SELECT * FROM $
WITH 
(  SRC='https://myhost.com/some-api'
  ,CachingMode='All'  --cache metadata and data rows both
  ,CacheStorage='File' --or Memory
  ,CacheFileLocation='c:\temp\myquery.cache'
  ,CacheEntryTtl=300 --cache for 300 seconds
)
</pre>
&nbsp;

&nbsp;
<h4><strong><span style="font-size: 14pt;">Use --FAST Option to enable Stream Mode</span></strong></h4>
ZappySys JSON / XML drivers support <strong>--FAST</strong> suffix for Filter. By using this suffix after Filter driver enables Stream Mode, <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/#Reading_Large_Files_Streaming_Mode_for_XML_JSON" target="_blank" rel="noopener">Read this article</a> to understand how this works.
<pre class="lang:default decode:true">SELECT * FROM $ 
LIMIT 10 --//add this just to test how fast you can get 10 rows
WITH(
  Filter='$.LargeArray[*]--FAST' --//Adding --FAST option turn on STREAM mode (large files)
 ,SRC='https://zappysys.com/downloads/files/test/large_file_100k_largearray_prop.json.gz'
 --,SRC='c:\data\large_file.json.gz'
 ,IncludeParentColumns='False'  --//This Must be OFF for STREAM mode (read very large files)
 ,FileCompressionType='GZip' --Zip or None (Zip format only available for Local files)
)</pre>
&nbsp;</div>
<h2>Calling SOAP Web Service in Talend</h2>
<div class="content_block" id="custom_post_widget-3870">To call SOAP API you need to know Request XML Body Structure. If you are not sure how to create SOAP Request body then no worries. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article</a> to learn how to generate SOAP Request body using the Free tool <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a>. Basically, you have to use SoapUI to generate Request XML and after that, you can replace parameters as needed in the generated body.
<h3>What is SOAP Web Service?</h3>
If you are new to SOAP Web Service sometimes referred as XML Web Service then please read some concept about SOAP Web service standard <a href="https://msdn.microsoft.com/en-us/library/ms996507.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener">from this link</a>

There are two important aspects in SOAP Web service.
<ol>
 	<li>Getting WSDL file or URL</li>
 	<li>Knowing exact Web Service URL</li>
</ol>
<h3>What is WSDL</h3>
In very simple term WSDL (often pronounced as whiz-dull) is nothing but a document which describes Service metadata (e.g. Functions you can call, Request parameters, response structure etc). Some service simply give you WSDL as xml file you can download on local machine and then analyze or sometimes you may get direct URL (e.g. http://api.mycompany.com/hr-soap-service/?wsdl )
<h3>Example SQL Query for SOAP API call using ZappySys XML Driver</h3>
Here is an example SQL query you can write to call SOAP API. If you not sure about many details then check next few sections on how to use XML Driver User Interface to build desired SQL query to POST data to XML SOAP Web Service without any coding.
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(
	 Src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
	,DataConnectionType='HTTP'
	,CredentialType='Basic' --OR SoapWss
	,SoapWssPasswordType='PasswordText'
	,UserName='myuser'
	,Password='pass$$w123'
	,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
	,ElementsToTreatAsArray='HolidayCode'	
	,RequestMethod='POST'	
	,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;hol:GetHolidaysAvailable&gt;
         &lt;!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]--&gt;
         &lt;hol:countryCode&gt;UnitedStates&lt;/hol:countryCode&gt;
      &lt;/hol:GetHolidaysAvailable&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
Now let's look at steps to create SQL query to call SOAP API. Later we will see how to generate code for your desired programming language (e.g. C# or SQL Server)
<h3>Video Tutorial - Introduction to SOAP Web Service and SoapUI tool</h3>
Before we dive into details about calling SOAP API using ZappySys XML Driver, lets first understand what is SOAP API and how to create SOAP requests using SoapUI tool. You will learn more about this process in the later section. The video contains some fragment about using SOAP API in SSIS but just ignore that part because we will be calling Soap API using ZappySys ODBC Driver rather than SSIS Components.

&nbsp;

<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/d_x5bgGjg0Y?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe>
<h3>Using SoapUI to test SOAP API call / Create Request Body XML</h3>
Assuming you have downloaded and installed <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI from here</a>, now we are ready to use WSDL for your SOAP Web Service Calls. If you do not have WSDL file or URL handy then contact your API provider (sometimes you just have to add <strong>?wsdl </strong>at the end of your Service URL to get WSDL so try that. Example: http://mycompany/myservice?wsdl ).

If you don't know what is WSDL then in short, WSDL is <strong>Web service Description Language</strong> (i.e. XML file which describes your SOAP Service). WSDL helps to craft SOAP API request Body for ZappySys XML Driver. So Let's get started.
<ol>
 	<li>Open SoapUI and click SOAP button to create new SOAP Project</li>
 	<li>Enter WSDL URL or File Path of WSDLFor example WSDL for our sample service can be accessed via this URL
<pre class="lang:default highlight:0 decode:true">http://www.dneonline.com/calculator.asmx?wsdl</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-import-wsdl-new-soapui-project.png"><img loading="lazy" decoding="async" class="size-full wp-image-3871" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-14.png" alt="Create new SOAP API Project in SoapUI tool for SOAP API Testing" width="486" height="349" /></a>
<div style="margin-bottom: 1em;">Create new SOAP API Project in SoapUI tool for SOAP API Testing</div></li>
 	<li>Once WSDL is loaded you will see possible operations you can call for your SOAP Web Service.</li>
 	<li>If your web service requires credentials then you have to configure it. There are two common credential types for public services (<strong>SOAP WSS</strong> or <strong>BASIC</strong> )
<ol>
 	<li>
<div style="margin-bottom: 1em;">To use <strong>SOAP WSS Credentials</strong> select request node and enter UserId, Password, and <strong>WSS-PasswordType</strong> (PasswordText or PasswordHash)</div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-soap-wss-credentials-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3872 alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)" width="294" height="544" /></a>
<div style="display: block;">Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)</div></li>
 	<li>To use <strong>BASIC Auth</strong> Credentials select request node and double-click it. At the bottom click on Auth (Basic) and From Authorization dropdown click Add New and Select Basic.<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-basic-authentication-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3873" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure Basic Authorization for SoapUI (SOAP API Testing Tool)" width="616" height="653" /></a>
<div style="margin-bottom: 1em;">Configure Basic Authorization for SoapUI (SOAP API Testing Tool)</div></li>
</ol>
</li>
 	<li>Now you can test your request first Double-click on the request node to open request editor.</li>
 	<li>Change necessary parameters, remove optional or unwanted parameters. If you want to regenerate request you can click on <strong>Recreate default request toolbar icon</strong>.
<a href="https://zappysys.com/blog/wp-content/uploads/2016/06/create-soap-request-with-optional-parameters-soapui.png"><img loading="lazy" decoding="async" class="size-full wp-image-2812" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-4.png" alt="Create SOAP Request XML (With Optional Parameters)" width="807" height="315" /></a>
<div style="margin-bottom: 1em;">Create SOAP Request XML (With Optional Parameters)</div></li>
 	<li>Once your SOAP Request XML is ready, <strong>Click the Play button</strong> in the toolbar to execute SOAP API Request and Response will appear in Right side panel.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soapui-test-soap-api-request-response-edit-xml-body.png"><img loading="lazy" decoding="async" class="size-full wp-image-3874" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-5.png" alt="Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)" width="1216" height="511" /></a>
Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)</li>
</ol>
<h3>Create DSN using ZappySys XML Driver to call SOAP API</h3>
Once you have tested your SOAP API in SoapUI tool, we are ready to use ZappySys XML driver to call SOAP API in your preferred BI tool or Programming language.
<ol>
 	<li>First open <strong>ODBC Data Sources</strong> (search ODBC in your start menu or go under ZappySys &gt; ODBC PowerPack &gt; <strong>ODBC 64 bit</strong>)</li>
 	<li>Goto <strong>System DSN</strong> Tab (or User DSN which is not used by Service account)</li>
 	<li>Click <strong>Add</strong> and Select ZappySys XML Driver
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3875" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-6.png" alt="ZappySys ODBC Driver for XML / SOAP API" width="593" height="459" /></a>
ZappySys ODBC Driver for XML / SOAP API</li>
 	<li>Configure API URL, Request Method and Request Body as below
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3876" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-7.png" alt="ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body" width="916" height="874" /></a>
ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body</li>
 	<li><strong>(This step is Optional)</strong> If your SOAP API requires credentials then Select Connection Type to HTTP and configure as below.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-call-credential-basic-soap-wss-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3877" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-8.png" alt="ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)" width="564" height="483" /></a>
<div style="display: block;">ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)</div></li>
 	<li>Configure-Request Headers as below (You can get it from Request &gt; Raw tab from SoapUI after you test the request by clicking the Play button)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/set-soap-api-request-headers-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3881" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-9.png" alt="Configure SOAP API Request Headers - ZappySys XML Driver" width="1009" height="747" /></a>
Configure SOAP API Request Headers - ZappySys XML Driver</li>
 	<li>Once credentials entered you can select Filter to extract data from the desired node. Make sure to select array node (see special icon) or select the node which contains all necessary columns if you don't have array node.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-query-select-filter-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3882" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-10.png" alt="Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)" width="809" height="594" /></a>
Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)</li>
 	<li>If prompted select yes to treat selected node as Array (This is helpful when you expect one or more record for selected node)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-api-array-handling-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3883" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-11.png" alt="Treat selected node as XML Array Option for SOAP API Response XML" width="655" height="572" /></a>
Treat selected node as XML Array Option for SOAP API Response XML</li>
</ol>
<h3>Preview SOAP API Response / Generate SQL Code for SOAP API Call</h3>
Once you configure settings for XML Driver now you can preview data or generate example code for desired language (e.g. C#, Python, Java, SQL Server).

Go to Preview tab and you will see default query generated based on settings you entered in previous sections. Attributes listed in WITH clause are optional. If you omit attribute in WITH clause it will use it from Properties tab.
<h3>Preview Data</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3884" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-12.png" alt="Preview SOAP API Response in ZappySys XML Driver" width="808" height="780" /></a>
Preview SOAP API Response in ZappySys XML Driver
<h3>Generate Code Option</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-driver-code-generator.png"><img loading="lazy" decoding="async" class="size-full wp-image-3885" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-13.png" alt="Generate Example Code for ZappySys Driver" width="572" height="618" /></a>
<div style="display: block;">Generate Example Code for ZappySys Driver</div></div>
<h2>Conclusion</h2>
<p>In this article, we used ZappySys Drivers to read data from JSON REST API / File. You can use same technique to consume SOAP / XML API or File. <a href="https://zappysys.com/products/odbc-powerpack/">Try ODBC PowerPack for FREE</a> and check out how easy it is to consume virtually any REST / SOAP API or Read from JSON / XML / CSV Files in  Talend Open Studio.</p>
<p>The post <a href="https://zappysys.com/blog/read-write-rest-api-data-in-talend-json-xml-soap/">Read / Write REST API data in Talend (JSON / XML / SOAP)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read JSON in Informatica &#8211; Import REST API / SOAP / JSON File</title>
		<link>https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 08 May 2018 21:01:37 +0000</pubDate>
				<category><![CDATA[ETL - Informatica]]></category>
		<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[etl]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=3450</guid>

					<description><![CDATA[<p>Introduction JSON / REST API is becoming more and more popular each day as everyone embrace cloud-centric services. This article is primarily focused on Informatica users who want to do XML SOAP/ JSON / REST API Integration in Informatica. However many tips and techniques described in this article will help you to understand how to integrate XML [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/">Read JSON in Informatica &#8211; Import REST API / SOAP / JSON File</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo.png"><img loading="lazy" decoding="async" class=" wp-image-3454 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo.png" alt="Informatica PowerCenter Logo" width="108" height="108" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo.png 200w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-logo-150x150.png 150w" sizes="(max-width: 108px) 100vw, 108px" /></a>JSON / REST API is becoming more and more popular each day as everyone embrace cloud-centric services. This article is primarily focused on Informatica users who want to do <strong>XML SOAP/ JSON / REST API Integration in Informatica</strong>. However many tips and techniques described in this article will help you to understand how to integrate XML SOAP / JSON / REST API in other ETL / Reporting apps such as Tableau, Power BI, SSRS, Talend, Excel and many more.</p>
<p>After going through this article you will learn <strong>how to Read JSON in Informatica </strong>and understand the <strong>concept of JSON / REST API</strong>. We will go through many screenshots and step-by-step examples to demonstrate  <strong>JSON File or REST API integration in Informatica PowerCenter.</strong></p>
<p>XML / JSON can come from a local file or REST API service (internal or public) so we will include both examples in this article (i.e. Read JSON files in Informatica,  Import REST API in Informatica). So let&#8217;s get started. Next article will focus on <a href="https://zappysys.com/blog/post-data-api-informatica-using-sql-transformation/" target="_blank" rel="noopener">how to write data to API in Informatica (POST / PUT data)</a></p>
<h2>Requirements</h2>
<p>This article assumes that you have full filled following basic requirements.</p>
<ol>
<li>Download Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> (Drivers for JSON and REST API)</li>
<li>Install Informatica PowerCenter Client Tools (e.g. Workflow and Mapping Designers)</li>
<li>Access to a Relational database such as SQL Server (or use any of your choice e.g. Oracle, MySQL, DB2 ). If nothing available then you can use flat file target.</li>
</ol>
<h2>How to Import JSON data using Informatica (Read JSON Files or REST API)</h2>
<p>Before we dive deep to learn how to load JSON data in Informatica (JSON to SQL Table), Here the summary of high-level steps you need to perform to import JSON Files or REST API in Informatica.</p>
<ol>
<li>Download and Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys JSON ODBC Driver</a> (for JSON Files and REST API)</li>
<li>Create ODBC DSN using ZappySys JSON driver for your API Service (You can override most of the DSN settings via SQL Query at runtime)</li>
<li>Create Relational &gt; <strong>ODBC</strong> Connection in <strong>Informatica Workflow designer</strong> (Point to JSON DSN we created in the previous step)</li>
<li>Import JSON Source Definition in the <strong>Informatica Mapping Designer</strong> &gt; <strong>Sources Tab</strong></li>
<li>Import Target Table Definition in the <strong>Informatica Mapping Designer</strong> &gt; <strong>Targets Tab</strong></li>
<li>Create source to target mapping in Mappings tab</li>
<li>Save mapping (name <strong>m_API_to_SQL_Load</strong> )</li>
<li>Create Session using the mapping we created in the previous step</li>
<li>Save Workflow and execute to load JSON data into SQL Table. Verify your data and log.
<div id="attachment_3475" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3475" class="wp-image-3475 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-768x379.png" alt="Loading JSON data to SQL Table in Informatica (Import REST API or JSON Files)" width="720" height="355" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-768x379.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-300x148.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-1024x505.png 1024w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png 1164w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-3475" class="wp-caption-text">Loading JSON data to SQL Table in Informatica (Import REST API or JSON Files)</p></div></li>
</ol>
<h2>Video Tutorial &#8211; Read JSON in Informatica (Load JSON to SQL Table)</h2>
<p>By watching following ~5 min video can learn steps listed in this article to load JSON API data into SQL Server Table using <strong>ZappySys JSON Driver</strong>. You can go though full article to learn many useful details not covered in this video.</p>
<a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FTaKp9Tewbr0%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>Getting Started &#8211; Import JSON to SQL Server in Informatica</h2>
<p>Now let&#8217;s get started. For example purpose, we will read data from OData JSON based REST API service and load data into SQL Server Table using Informatica Workflow.</p>
<h3>Create ODBC DSN using ZappySys JSON Driver</h3>
<p>The first step to read from JSON File or REST API Service in Informatica is to create ODBC DSN.</p>
<ol>
<li>Search for ODBC in your start menu and open <strong>ODBC Data Sources (64bit)</strong>. You can also find same under ZappySys &gt; ODBC PowerPack &gt; ODBC Data Sources (64bit)</li>
<li>When ODBC UI shows up, Go to System tab.</li>
<li>Click on <strong>Add</strong></li>
<li>Select <strong>ZappySys JSON Driver</strong> from the list and click Finish.
<div id="attachment_3457" style="width: 578px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/create-odbc-dsn-for-informatica-json-file-rest-api-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3457" class="size-full wp-image-3457" src="https://zappysys.com/blog/wp-content/uploads/2018/05/create-odbc-dsn-for-informatica-json-file-rest-api-connection.png" alt="Create New DSN for JSON File or REST API - Use ZappySys JSON Driver" width="568" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/create-odbc-dsn-for-informatica-json-file-rest-api-connection.png 568w, https://zappysys.com/blog/wp-content/uploads/2018/05/create-odbc-dsn-for-informatica-json-file-rest-api-connection-300x266.png 300w" sizes="(max-width: 568px) 100vw, 568px" /></a><p id="caption-attachment-3457" class="wp-caption-text">Create New DSN for JSON File or REST API &#8211; Use ZappySys JSON Driver</p></div></li>
<li>When Configuration UI enter the following URL for Data source. You can also enter JSON File path here too but for this example, we will use OData REST API (JSON Format). Click Test to confirm its working. This API doesn&#8217;t use any credentials but in the real world, you may have credentials (e.g. OAuth creds using Key / Secret or Basic Auth using UserID / Password). Below URL is default URL for your DSN. You can always override URL and other settings from SQL Query using WITH Clause (<a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">see examples</a>)<br />
<pre class="crayon-plain-tag">https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json</pre>
<div id="attachment_3458" style="width: 724px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-odbc-dsn.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3458" class="wp-image-3458 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-odbc-dsn.png" alt="Configure ODBC DSN - Import JSON in Informatica (REST API or JSON Files)" width="714" height="742" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-odbc-dsn.png 714w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-odbc-dsn-289x300.png 289w" sizes="(max-width: 714px) 100vw, 714px" /></a><p id="caption-attachment-3458" class="wp-caption-text">Configure ODBC DSN for JSON Data</p></div></li>
<li>Optionally one more setting you can change is Under <strong>Other settings</strong> &gt;&gt;&gt;  <strong>Date data type</strong> set option to <strong>Convert to DateTime (Timezone lost)</strong>. If you don&#8217;t do this then OrderDate field or any other Date Field will be detected as nstring in Informatica. Later in this section, we will show you how to convert nstring to DateTime using Expression Transform (TO_DATE function).</li>
<li>Now switch to Preview Tab and try some sample queries to learn more about API driver. For example, you can try some with simple queries like below. For more advanced queries <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">read this help file</a>.<strong>Read from root level (include all attributes)</strong><br />
<pre class="crayon-plain-tag">select * from $</pre>
<strong>Read from an array (value tag)</strong><br />
<pre class="crayon-plain-tag">select * from value
--OR--
select * from $ WITH (Filter='$.value[*]')</pre>
<strong>Override URL (Supply different URL than entered in ODBC DSN UI)</strong><br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH (SRC='https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=demo&amp;count=20', 
Filter='$.contacts[*]')</pre>
</li>
<li>Click on <strong>View Examples</strong> to check other example queries
<div id="attachment_3469" style="width: 696px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-rest-api-query-examples.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3469" class="size-full wp-image-3469" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-rest-api-query-examples.png" alt="ODBC JSON Driver Query Preview - Informatica JSON Query Examples (Read REST API or JSON Files)" width="686" height="789" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-rest-api-query-examples.png 686w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-rest-api-query-examples-261x300.png 261w" sizes="(max-width: 686px) 100vw, 686px" /></a><p id="caption-attachment-3469" class="wp-caption-text">ODBC JSON Driver Query Preview &#8211; Informatica JSON Query Examples (Read REST API or JSON Files)</p></div></li>
<li>Click OK to save your DSN Properties.</li>
<li>Click OK to close ODBC Data SOurces UI.</li>
</ol>
<h3>Create Connection in Informatica Workflow Designer</h3>
<p>Once you create DSN using JSON Driver our next step is to define a connection for JSON source in Informatica PowerCenter Workflow designer.</p>
<ol>
<li>Open Workflow designer [W] icon</li>
<li>Goto <strong>Connections</strong> &gt; <strong>Relational</strong>
<div id="attachment_3471" style="width: 342px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-designer-create-connection-for-json-file-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3471" class="size-full wp-image-3471" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-designer-create-connection-for-json-file-rest-api.png" alt="Create new connection for JSON in Informatica" width="332" height="182" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-designer-create-connection-for-json-file-rest-api.png 332w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-designer-create-connection-for-json-file-rest-api-300x164.png 300w" sizes="(max-width: 332px) 100vw, 332px" /></a><p id="caption-attachment-3471" class="wp-caption-text">Create a new connection for JSON in Informatica</p></div></li>
<li>Click <strong>New</strong> and select ODBC
<div id="attachment_3472" style="width: 424px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-create-odbc-connection-json-file-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3472" class="size-full wp-image-3472" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-create-odbc-connection-json-file-rest-api.png" alt="Select ODBC connection type in Informatica (Using ZappySys JSON ODBC DSN)" width="414" height="478" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-create-odbc-connection-json-file-rest-api.png 414w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-powercenter-create-odbc-connection-json-file-rest-api-260x300.png 260w" sizes="(max-width: 414px) 100vw, 414px" /></a><p id="caption-attachment-3472" class="wp-caption-text">Select ODBC connection type in Informatica (Using ZappySys JSON ODBC DSN)</p></div></li>
<li>Now on the ODBC connection setup enter connection name, some <strong>fake userid / password</strong> (this is a required field but its ignored by JSON Driver)</li>
<li>In the <strong>Connection String</strong> field enter the exact same name of DSN (Open ODBC Data Sources UI to confirm)
<div id="attachment_3473" style="width: 480px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3473" class="size-full wp-image-3473" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api.png" alt="Configure JSON connection in Informatica for REST API / JSON File connectivity - Using ZappySys JSON ODBC Driver" width="470" height="560" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api.png 470w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-connection-for-json-file-rest-api-252x300.png 252w" sizes="(max-width: 470px) 100vw, 470px" /></a><p id="caption-attachment-3473" class="wp-caption-text">Configure JSON connection in Informatica for REST API<br />/ JSON File connectivity &#8211; Using ZappySys JSON ODBC Driver</p></div></li>
<li>Click OK to close the connection properties.</li>
</ol>
<p>That&#8217;s it. Now we ready to move to next step (define source and target in Mapping Designer).</p>
<h3>Import JSON Source Definition in Informatica Mapping Designer</h3>
<p>Now let&#8217;s look at steps to import JSON source table definition.</p>
<ol>
<li>Open Informatica Mapping Designer (Click [D] icon)</li>
<li>Click on Source Icon to switch to Sources designer</li>
<li>From the <strong>top menu</strong> &gt; Click on <strong>Sources</strong> &gt; <strong>Import from Database</strong> &#8230;
<div id="attachment_3476" style="width: 533px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-source-definition.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3476" class="size-full wp-image-3476" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-source-definition.png" alt="Import JSON Source definition in Informatica Mapping Designer (JSON file or REST API)" width="523" height="224" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-source-definition.png 523w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-source-definition-300x128.png 300w" sizes="(max-width: 523px) 100vw, 523px" /></a><p id="caption-attachment-3476" class="wp-caption-text">Import JSON Source definition in Informatica Mapping Designer (JSON file or REST API)</p></div></li>
<li>Select ODBC data source from the dropdown (Find out DSN we created earlier to use as JSON Source)</li>
<li>Click Connect button to get a list of tables. Any array node is listed as a table. Also, you will see array node with parent columns (e.g. value_with_parent). You may get some warning like below but they are harmless so just ignore by clicking OK.<br />
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">DLL name entry missing from C:\Informatica\PowerCenter8.6.1\client\bin\powrmart.ini Section = ODBCDLL Entry = ZappySys JSON Driver<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Using EXTODBC.DLL to support ZappySys JSON Driver. For native support of ZappySys JSON Driver make an entry in the .ini file.</div></div>
<div id="attachment_3477" style="width: 580px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3477" class="size-full wp-image-3477" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table.png" alt="Select JSON Source Table in Informatica Mapping Designer (JSON file or REST API)" width="570" height="335" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table.png 570w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-source-json-select-table-300x176.png 300w" sizes="(max-width: 570px) 100vw, 570px" /></a><p id="caption-attachment-3477" class="wp-caption-text">Select JSON Source Table in Informatica Mapping Designer (JSON file or REST API)</p></div></li>
<li>Select Table you wish to get (You can filter rows by custom SQL query. We will see later in this article how to do)</li>
<li>Optionally once table structure is imported you can rename it
<div id="attachment_3478" style="width: 606px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-rename-source-table-name.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3478" class="size-full wp-image-3478" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-rename-source-table-name.png" alt="Rename imported table definition in Informatica Source Designer" width="596" height="431" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-rename-source-table-name.png 596w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-rename-source-table-name-300x217.png 300w" sizes="(max-width: 596px) 100vw, 596px" /></a><p id="caption-attachment-3478" class="wp-caption-text">Rename imported table definition in Informatica Source Designer</p></div></li>
<li>That&#8217;s it, we are now ready to perform similar steps to import Target table structure in the next section.</li>
</ol>
<h3>Import SQL Server Target Definition in Informatica Mapping Designer</h3>
<p>Now let&#8217;s look at steps to import Target table definition (very similar to the previous section, the only difference is this time we will select DSN which points to SQL Server or any other Target Server). For example purpose, we will use following table structure as our SQL Server Table. If its missing you can create one.</p><pre class="crayon-plain-tag">CREATE TABLE [dbo].[Tbl_Invoices](
	[ShipName] [nvarchar](40) NULL,
	[ShipAddress] [nvarchar](60) NULL,
	[ShipCity] [nvarchar](15) NULL,
	[ShipRegion] [nvarchar](15) NULL,
	[ShipPostalCode] [nvarchar](10) NULL,
	[ShipCountry] [nvarchar](15) NULL,
	[CustomerID] [nchar](5) NULL,
	[CustomerName] [nvarchar](40) NULL,
	[Address] [nvarchar](60) NULL,
	[City] [nvarchar](15) NULL,
	[Region] [nvarchar](15) NULL,
	[PostalCode] [nvarchar](10) NULL,
	[Country] [nvarchar](15) NULL,
	[Salesperson] [nvarchar](31) NULL,
	[OrderID] [int] NULL,
	[OrderDate] [datetime] NULL,
	[RequiredDate] [datetime] NULL,
	[ShippedDate] [datetime] NULL,
	[ShipperName] [nvarchar](40) NULL,
	[ProductID] [int] NULL,
	[ProductName] [nvarchar](40) NULL,
	[UnitPrice] [money] NULL,
	[Quantity] [smallint] NULL,
	[Discount] [real] NULL,
	[ExtendedPrice] [money] NULL,
	[Freight] [money] NULL
)</pre><p>
Now lets look at steps to import target table definition in Informatica mapping designer.</p>
<ol>
<li>In the Mapping Designer, Click on Target Icon to switch to Target designer</li>
<li>From the <strong>top menu</strong> &gt; Click on <b>Targets </b>&gt; <strong>Import from Database</strong> &#8230;</li>
<li>Select DSN for your Target server (if DSN doesn&#8217;t exist then create one by opening ODBC Sources just like we created one for JSON API source (see the previous section about creating DSN).
<div id="attachment_3480" style="width: 535px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3480" class="size-full wp-image-3480" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition.png" alt="Import target Table Definition in informatica" width="525" height="224" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition.png 525w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-300x128.png 300w" sizes="(max-width: 525px) 100vw, 525px" /></a><p id="caption-attachment-3480" class="wp-caption-text">Import target Table Definition in informatica</p></div></li>
<li>Enter your userid , password and Schema name and click Connect to see tables</li>
<li>Select Table name to and click OK import definition.
<div id="attachment_3479" style="width: 579px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-select-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3479" class="size-full wp-image-3479" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-select-table.png" alt="Import Target SQL Table Definition in Informatica - Select table from the list" width="569" height="386" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-select-table.png 569w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-sql-server-target-definition-select-table-300x204.png 300w" sizes="(max-width: 569px) 100vw, 569px" /></a><p id="caption-attachment-3479" class="wp-caption-text">Import Target SQL Table Definition in Informatica &#8211; Select table from the list</p></div></li>
</ol>
<h3>Create Source to Target Mapping in Informatica (Import JSON to SQL Server)</h3>
<p>Once you have imported source and target table definition, we can create mapping and transformation to load data from JSON to SQL Table.</p>
<ol>
<li>First open Mapping Designer (Click [D] icon)</li>
<li>Drag JSON Source from sources folder</li>
<li>Drag SQL Table from Targets folder</li>
<li>Map desired columns from Source to target
<div id="attachment_3482" style="width: 1136px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3482" class="size-full wp-image-3482" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file.png" alt="Define Source to Target mapping for JSON to SQL Table load in Informatica" width="1126" height="565" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file.png 1126w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file-300x151.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file-768x385.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-json-to-sql-server-data-load-mapping-rest-api-json-file-1024x514.png 1024w" sizes="(max-width: 1126px) 100vw, 1126px" /></a><p id="caption-attachment-3482" class="wp-caption-text">Define Source to Target mapping for JSON to SQL Table load in Informatica</p></div></li>
<li>For certain columns you may have to do datatype conversion. For example to convert OrderDate form nstring to DataTime you have to use Expression Transform like below and map it to target. In below example, our JSON has date format (e.g. <strong>2018-01-31 12:00:00 AM</strong> ). To import this to DateTime field in SQL server we need to convert it using TO_DATE function. Use double quotes around T to make this format working.<br />
<pre class="crayon-plain-tag">TO_DATE(OrderDate,'YYYY-MM-DD H12:MI:SS AM')

--For ISO use below way
TO_DATE(OrderDate,'YYYY-MM-DD"T"HH24:MI:SS')</pre>
<div id="attachment_3481" style="width: 1037px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3481" class="size-full wp-image-3481" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format.png" alt="Informatica JSON to SQL Table Mapping - Datatype conversion (nstring to datetime) " width="1027" height="508" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format.png 1027w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format-300x148.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format-768x380.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-import-json-to-sql-datetime-convert-iso-format-1024x507.png 1024w" sizes="(max-width: 1027px) 100vw, 1027px" /></a><p id="caption-attachment-3481" class="wp-caption-text">Informatica JSON to SQL Table Mapping &#8211; Datatype conversion (nstring to datetime)</p></div></li>
<li>Once you done with mapping save your mapping and name it (i.e. m_Api_To_SQL)</li>
<li>Now lets move to next section to create workflow.</li>
</ol>
<h3>Create Workflow and Session in Informatica</h3>
<p>Now the final step is to create a new workflow. Perform following steps to create workflow which with a session task to import JSON data into SQL table.</p>
<ol>
<li>Open workflow designer by click [W] icon.</li>
<li>Launch new workflow creation wizard by <strong>click Workflow top menu</strong> &gt;  <strong>Wizard</strong><br />
name your workflow (e.g. wf_Api_Tp_Sql_Table_Import)</p>
<div id="attachment_3484" style="width: 662px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-workflow-import-json-api-to-sql-table-wizard.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3484" class="size-full wp-image-3484" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-workflow-import-json-api-to-sql-table-wizard.png" alt="Creating Informatica Workflow - Wizard UI (Import JSON data to SQL Table)" width="652" height="516" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-workflow-import-json-api-to-sql-table-wizard.png 652w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-workflow-import-json-api-to-sql-table-wizard-300x237.png 300w" sizes="(max-width: 652px) 100vw, 652px" /></a><p id="caption-attachment-3484" class="wp-caption-text">Creating Informatica Workflow &#8211; Wizard UI (Import JSON data to SQL Table)</p></div></li>
<li>Finish the wizard and double-click the Session to edit some default properties.</li>
<li>First change Error settings so we fail session on error (By default its always green)
<div id="attachment_3485" style="width: 404px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-session-stop-on-error.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3485" class="size-full wp-image-3485" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-session-stop-on-error.png" alt="Fail Informatica Session on error (JSON to SQL Load)" width="394" height="381" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-session-stop-on-error.png 394w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-session-stop-on-error-300x290.png 300w" sizes="(max-width: 394px) 100vw, 394px" /></a><p id="caption-attachment-3485" class="wp-caption-text">Fail Informatica Session on error (JSON to SQL Load)</p></div></li>
<li>Select JSON connection for Source
<div id="attachment_3486" style="width: 740px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-json-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3486" class="size-full wp-image-3486" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-json-connection.png" alt="Select JSON Source Connection in Informatica - JSON File / REST API Load to SQL Table" width="730" height="661" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-json-connection.png 730w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-json-connection-300x272.png 300w" sizes="(max-width: 730px) 100vw, 730px" /></a><p id="caption-attachment-3486" class="wp-caption-text">Select JSON Source Connection in Informatica &#8211; JSON File / REST API Load to SQL Table</p></div></li>
<li>Change default Source query if needed. You can pass parameters to this query to make it dynamic.
<div id="attachment_3487" style="width: 746px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-call-rest-api-pass-parameters-runtime-dynamic-sql.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3487" class="size-full wp-image-3487" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-call-rest-api-pass-parameters-runtime-dynamic-sql.png" alt="Modify JSON Source SQL query - Pass parameters, change URL, set filter etc" width="736" height="712" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-call-rest-api-pass-parameters-runtime-dynamic-sql.png 736w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-call-rest-api-pass-parameters-runtime-dynamic-sql-300x290.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-3487" class="wp-caption-text">Modify JSON Source SQL query &#8211; Pass parameters, change URL, set filter etc</p></div></li>
<li>Select Target connection of SQL Target Table
<div id="attachment_3488" style="width: 830px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3488" class="size-full wp-image-3488" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection.png" alt="Select SQL Target Connection in Informatica - JSON File / REST API Load to SQL Table" width="820" height="647" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection.png 820w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection-300x237.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-create-workflow-session-configure-sql-target-connection-768x606.png 768w" sizes="(max-width: 820px) 100vw, 820px" /></a><p id="caption-attachment-3488" class="wp-caption-text">Select SQL Target Connection in Informatica &#8211; JSON File / REST API Load to SQL Table</p></div></li>
<li>Save workflow</li>
<li>That&#8217;s it. We ready to run our first workflow to load JSON data to SQL.</li>
</ol>
<h3>Execute Workflow and Validate Log in Informatica</h3>
<p>Now once you are done with your workflow, execute it to see the log.</p>
<div id="attachment_3475" style="width: 1174px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3475" class="size-full wp-image-3475" src="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png" alt="Loading JSON data to SQL Table in Informatica (Import REST API or JSON Files)" width="1164" height="574" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import.png 1164w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-300x148.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-768x379.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/informatica-execution-log-json-to-sql-import-1024x505.png 1024w" sizes="(max-width: 1164px) 100vw, 1164px" /></a><p id="caption-attachment-3475" class="wp-caption-text">Loading JSON data to SQL Table in Informatica (Import REST API or JSON Files)</p></div>
<p>&nbsp;</p>
<h2>Import JSON Files in Informatica (Single or multiple)</h2>
<p>So far we have seen an example of loading JSON REST API in Informatica but loading JSON files are pretty much same process. Rather than URL, you have to specify JSON file path as Data source.</p>
<p>ZappySys JSON Driver is capable of reading from JSON file, REST API, and embedded JSON string.</p>
<p><strong>Reading JSON data from single File Informatica</strong></p>
<p>select * from $ (SRC=&#8217;c:\data\customer_2015.json&#8217;, Filter=&#8217;$.rows[*]&#8217;)</p>
<p><strong>Reading JSON data from multiple Files in Informatica</strong></p>
<p>select * from $ (SRC=&#8217;c:\data\customer_*.json&#8217;, Filter=&#8217;$.rows[*]&#8217;)</p>
<p><strong>Reading JSON data from embedded string</strong></p><pre class="crayon-plain-tag">SELECT * FROM $ 
WITH 
(
Filter='$.rows[*]',
DATA='
{          
  rows : [
        {id:1, name: "AAA"}, 
        {id:2, name: "BBB"}, 
        {id:3, name: "CCC"}
  ]
}'
)</pre><p>
&nbsp;</p>
<h2>Import XML Files in Informatica</h2>
<p>Reading from XML files or API can be done using the same way as previous sections except you have to use ZappySys XML Driver. Read help file here to <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/xml-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">see examples</a>.</p>
<h2>POST data to REST API in Informatica</h2>
<p>There will be a time when you like to send Source data to REST API or SOAP Web Service. You can use below Query for example. For detailed explanation on how to <a href="https://zappysys.com/blog/post-data-api-informatica-using-sql-transformation/" target="_blank" rel="noopener">POST data in Informatica check this article</a>.</p><pre class="crayon-plain-tag">SELECT * FROM $
WITH 
(METHOD='POST' 
,HEADER='Content-Type:text/plain || x-hdr1:AAA'
,SRC='http://httpbin.org/post'
,BODY='{ data of body goes here }'
)</pre><p>
<h3>Video Tutorial &#8211; How to POST data to REST API in Informatica</h3>
<p>Here is detailed step by step video on REST API POST in informatica PowerCenter</p>
<a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FMKekE5w0rCk%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>&nbsp;</p>
<h2>Upload file to REST API in Informatica</h2>
<p>Above example was POST data to API URL but what if your Request Body is large and you have saved that to file? Well here is the way to get your request body from a file (Use @ symbol before path and add IsMultiPart=&#8217;True&#8217;). Refer to this post to <a href="https://zappysys.com/blog/rest-api-file-upload-using-ssis-multi-part-post/" target="_blank" rel="noopener">learn more about Raw Upload and Multi-Part Upload</a></p><pre class="crayon-plain-tag">SELECT * FROM $
WITH 
(METHOD='POST' 
,HEADER='Content-Type:text/plain || x-hdr1:AAA'
,SRC='http://httpbin.org/post'
,BODY='@c:\files\dump.xml'
,IsMultiPart='True'
)</pre><p>
<h2>Calling XML SOAP Web Service in Informatica</h2>
<p>So far we have looked at examples to consume data using JSON driver. Now lets look at an example, to call XML SOAP Web Service in Informatica.</p>
<div class="content_block" id="custom_post_widget-3870">To call SOAP API you need to know Request XML Body Structure. If you are not sure how to create SOAP Request body then no worries. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article</a> to learn how to generate SOAP Request body using the Free tool <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a>. Basically, you have to use SoapUI to generate Request XML and after that, you can replace parameters as needed in the generated body.
<h3>What is SOAP Web Service?</h3>
If you are new to SOAP Web Service sometimes referred as XML Web Service then please read some concept about SOAP Web service standard <a href="https://msdn.microsoft.com/en-us/library/ms996507.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener">from this link</a>

There are two important aspects in SOAP Web service.
<ol>
 	<li>Getting WSDL file or URL</li>
 	<li>Knowing exact Web Service URL</li>
</ol>
<h3>What is WSDL</h3>
In very simple term WSDL (often pronounced as whiz-dull) is nothing but a document which describes Service metadata (e.g. Functions you can call, Request parameters, response structure etc). Some service simply give you WSDL as xml file you can download on local machine and then analyze or sometimes you may get direct URL (e.g. http://api.mycompany.com/hr-soap-service/?wsdl )
<h3>Example SQL Query for SOAP API call using ZappySys XML Driver</h3>
Here is an example SQL query you can write to call SOAP API. If you not sure about many details then check next few sections on how to use XML Driver User Interface to build desired SQL query to POST data to XML SOAP Web Service without any coding.
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(
	 Src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
	,DataConnectionType='HTTP'
	,CredentialType='Basic' --OR SoapWss
	,SoapWssPasswordType='PasswordText'
	,UserName='myuser'
	,Password='pass$$w123'
	,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
	,ElementsToTreatAsArray='HolidayCode'	
	,RequestMethod='POST'	
	,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;hol:GetHolidaysAvailable&gt;
         &lt;!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]--&gt;
         &lt;hol:countryCode&gt;UnitedStates&lt;/hol:countryCode&gt;
      &lt;/hol:GetHolidaysAvailable&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
Now let's look at steps to create SQL query to call SOAP API. Later we will see how to generate code for your desired programming language (e.g. C# or SQL Server)
<h3>Video Tutorial - Introduction to SOAP Web Service and SoapUI tool</h3>
Before we dive into details about calling SOAP API using ZappySys XML Driver, lets first understand what is SOAP API and how to create SOAP requests using SoapUI tool. You will learn more about this process in the later section. The video contains some fragment about using SOAP API in SSIS but just ignore that part because we will be calling Soap API using ZappySys ODBC Driver rather than SSIS Components.

&nbsp;

<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/d_x5bgGjg0Y?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe>
<h3>Using SoapUI to test SOAP API call / Create Request Body XML</h3>
Assuming you have downloaded and installed <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI from here</a>, now we are ready to use WSDL for your SOAP Web Service Calls. If you do not have WSDL file or URL handy then contact your API provider (sometimes you just have to add <strong>?wsdl </strong>at the end of your Service URL to get WSDL so try that. Example: http://mycompany/myservice?wsdl ).

If you don't know what is WSDL then in short, WSDL is <strong>Web service Description Language</strong> (i.e. XML file which describes your SOAP Service). WSDL helps to craft SOAP API request Body for ZappySys XML Driver. So Let's get started.
<ol>
 	<li>Open SoapUI and click SOAP button to create new SOAP Project</li>
 	<li>Enter WSDL URL or File Path of WSDLFor example WSDL for our sample service can be accessed via this URL
<pre class="lang:default highlight:0 decode:true">http://www.dneonline.com/calculator.asmx?wsdl</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-import-wsdl-new-soapui-project.png"><img loading="lazy" decoding="async" class="size-full wp-image-3871" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-14.png" alt="Create new SOAP API Project in SoapUI tool for SOAP API Testing" width="486" height="349" /></a>
<div style="margin-bottom: 1em;">Create new SOAP API Project in SoapUI tool for SOAP API Testing</div></li>
 	<li>Once WSDL is loaded you will see possible operations you can call for your SOAP Web Service.</li>
 	<li>If your web service requires credentials then you have to configure it. There are two common credential types for public services (<strong>SOAP WSS</strong> or <strong>BASIC</strong> )
<ol>
 	<li>
<div style="margin-bottom: 1em;">To use <strong>SOAP WSS Credentials</strong> select request node and enter UserId, Password, and <strong>WSS-PasswordType</strong> (PasswordText or PasswordHash)</div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-soap-wss-credentials-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3872 alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)" width="294" height="544" /></a>
<div style="display: block;">Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)</div></li>
 	<li>To use <strong>BASIC Auth</strong> Credentials select request node and double-click it. At the bottom click on Auth (Basic) and From Authorization dropdown click Add New and Select Basic.<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-basic-authentication-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3873" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure Basic Authorization for SoapUI (SOAP API Testing Tool)" width="616" height="653" /></a>
<div style="margin-bottom: 1em;">Configure Basic Authorization for SoapUI (SOAP API Testing Tool)</div></li>
</ol>
</li>
 	<li>Now you can test your request first Double-click on the request node to open request editor.</li>
 	<li>Change necessary parameters, remove optional or unwanted parameters. If you want to regenerate request you can click on <strong>Recreate default request toolbar icon</strong>.
<a href="https://zappysys.com/blog/wp-content/uploads/2016/06/create-soap-request-with-optional-parameters-soapui.png"><img loading="lazy" decoding="async" class="size-full wp-image-2812" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-4.png" alt="Create SOAP Request XML (With Optional Parameters)" width="807" height="315" /></a>
<div style="margin-bottom: 1em;">Create SOAP Request XML (With Optional Parameters)</div></li>
 	<li>Once your SOAP Request XML is ready, <strong>Click the Play button</strong> in the toolbar to execute SOAP API Request and Response will appear in Right side panel.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soapui-test-soap-api-request-response-edit-xml-body.png"><img loading="lazy" decoding="async" class="size-full wp-image-3874" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-5.png" alt="Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)" width="1216" height="511" /></a>
Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)</li>
</ol>
<h3>Create DSN using ZappySys XML Driver to call SOAP API</h3>
Once you have tested your SOAP API in SoapUI tool, we are ready to use ZappySys XML driver to call SOAP API in your preferred BI tool or Programming language.
<ol>
 	<li>First open <strong>ODBC Data Sources</strong> (search ODBC in your start menu or go under ZappySys &gt; ODBC PowerPack &gt; <strong>ODBC 64 bit</strong>)</li>
 	<li>Goto <strong>System DSN</strong> Tab (or User DSN which is not used by Service account)</li>
 	<li>Click <strong>Add</strong> and Select ZappySys XML Driver
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3875" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-6.png" alt="ZappySys ODBC Driver for XML / SOAP API" width="593" height="459" /></a>
ZappySys ODBC Driver for XML / SOAP API</li>
 	<li>Configure API URL, Request Method and Request Body as below
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3876" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-7.png" alt="ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body" width="916" height="874" /></a>
ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body</li>
 	<li><strong>(This step is Optional)</strong> If your SOAP API requires credentials then Select Connection Type to HTTP and configure as below.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-call-credential-basic-soap-wss-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3877" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-8.png" alt="ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)" width="564" height="483" /></a>
<div style="display: block;">ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)</div></li>
 	<li>Configure-Request Headers as below (You can get it from Request &gt; Raw tab from SoapUI after you test the request by clicking the Play button)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/set-soap-api-request-headers-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3881" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-9.png" alt="Configure SOAP API Request Headers - ZappySys XML Driver" width="1009" height="747" /></a>
Configure SOAP API Request Headers - ZappySys XML Driver</li>
 	<li>Once credentials entered you can select Filter to extract data from the desired node. Make sure to select array node (see special icon) or select the node which contains all necessary columns if you don't have array node.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-query-select-filter-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3882" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-10.png" alt="Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)" width="809" height="594" /></a>
Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)</li>
 	<li>If prompted select yes to treat selected node as Array (This is helpful when you expect one or more record for selected node)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-api-array-handling-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3883" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-11.png" alt="Treat selected node as XML Array Option for SOAP API Response XML" width="655" height="572" /></a>
Treat selected node as XML Array Option for SOAP API Response XML</li>
</ol>
<h3>Preview SOAP API Response / Generate SQL Code for SOAP API Call</h3>
Once you configure settings for XML Driver now you can preview data or generate example code for desired language (e.g. C#, Python, Java, SQL Server).

Go to Preview tab and you will see default query generated based on settings you entered in previous sections. Attributes listed in WITH clause are optional. If you omit attribute in WITH clause it will use it from Properties tab.
<h3>Preview Data</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3884" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-12.png" alt="Preview SOAP API Response in ZappySys XML Driver" width="808" height="780" /></a>
Preview SOAP API Response in ZappySys XML Driver
<h3>Generate Code Option</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-driver-code-generator.png"><img loading="lazy" decoding="async" class="size-full wp-image-3885" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-13.png" alt="Generate Example Code for ZappySys Driver" width="572" height="618" /></a>
<div style="display: block;">Generate Example Code for ZappySys Driver</div></div>
<h2>REST API Pagination in Informatica</h2>
<div class="content_block" id="custom_post_widget-3892"><div style="margin-bottom: 1em;">Even we set up ODBC Data Source to get the data, it may not be enough. Usually, if you are getting a huge data set from API provider, it won't give it to you in one HTTP response. Instead, it gives back only a subset of data and provides a mechanism for data pagination. The good news is that <em>ZappySys ODBC Driver</em> includes many options to cover virtually any pagination method.</div>
<div><span style="font-size: 16px;">Below you will find a few examples of API pagination. If you need something more sophisticated check the below link (the article was written for SSIS PowerPack but UI options and concepts apply to ODBC Driver too):</span></div>
<div style="margin-bottom: 1em;"><a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/</a></div>
<h3>Paginate by Response Attribute</h3>
This example shows how to paginate API calls where you need to paginate until the last page detected. In this example, next page is indicated by some attribute called nextlink (found in response). If this attribute is missing or null then it stops fetching the next page.
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH(
SRC=@'https://zappysys.com/downloads/files/test/pagination_nextlink_inarray_1.json'
,NextUrlAttributeOrExpr = '$.nextlink'  --keep reading until this attribute is missing. If attribute name contains dot then use brackets like this $.['my.attr.name']
)</pre>
<h3>Paginate by URL Parameter (Loop until certain StatusCode)</h3>
This example shows how to paginate API calls where you need to pass page number via URL. The driver keeps incrementing page number and calls next URL until the last page detected (401 error). There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/page-xml.aspx?page=1&amp;mode=DetectBasedOnResponseStatusCode'
,PagingMode='ByUrlParameter'
,PagingByUrlAttributeName='page'
,PagingByUrlEndStrategy='DetectBasedOnResponseStatusCode'
,PagingByUrlCheckResponseStatusCode=401
,IncrementBy=1
)</pre>
<h3>Paginate by URL Path (Loop until no record)</h3>
This example shows how to paginate API calls where you need to pass page number via URL Path. The driver keeps incrementing page number and calls next URL until the last page is detected. There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/cust-&lt;%page%&gt;.xml'
,PagingMode='ByUrlPath'
,PagingByUrlAttributeName='&lt;%page%&gt;'
,PagingByUrlEndStrategy='DetectBasedOnRecordCount'
,IncrementBy=1
)</pre>
<h3>Paginate by Header Link (RFC 5988)</h3>
API like GitHub / Wordpress use Next link in Headers (<a href="https://tools.ietf.org/html/rfc5988" target="_blank" rel="noopener">RFC 5988</a>)
<pre class="lang:default decode:true ">SELECT * FROM $
LIMIT 25
WITH(
	 Src='https://wordpress.org/news/wp-json/wp/v2/categories?per_page=10'
	,PagingMode='ByResponseHeaderRfc5988'
	,WaitTimeMs='200' --//wait 200 ms after each request
)</pre>
&nbsp;</div>
<h2>Error Handling in REST API</h2>
<div class="content_block" id="custom_post_widget-3894">Sometimes errors occur... they just do and there is nothing you can do! Or can you? Actually, in ODBC PowerPack you can handle them in two ways.
<h3>METHOD 1 - Using Error Handling Options</h3>
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3949" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-1.png" alt="" width="668" height="702" />
<h4>When to use?</h4>
You may want to use them when your source is a resource located on the Internet; e.g. a file on a website, a file on an FTP server or just a plain API HTTP response. By default, when a remote server returns an error, data retrieval is stopped, an error is raised and no data is given back to you. This might not be always desirable.
<h4>Scenario 1</h4>
Imagine a scenario, that there is a web server which each day at 12 AM releases a new JSON file with that day's date as filename, e.g. <span style="text-decoration: underline;"><em>http://www.some-server.com/data/2018-06-20.json</em></span>. And, of course, you want to download it and use it daily in your Power BI report. But you have a problem: Power BI report data sources are refreshed each hour and you may get <a href="https://en.wikipedia.org/wiki/HTTP_404" target="_blank" rel="noopener">HTTP 404 status code</a> (no file was found) when a file is not released yet. Which consequentially means other data sources won't be updated as well and you will see old and cached data on the report. That's where you could use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue when Url is invalid or missing (404 Errors)</span></strong> to avoid an error being raised and let other data sources to be updated.
<h4>Scenario 2</h4>
Another scenario is when you expect a web server to raise some kind of HTTP error when accessing a URL. You don't want ODBC Data Source to raise an error but instead, you want to get response data. That's where you can use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or alike together with  <strong><span class="lang:default highlight:0 decode:true crayon-inline">Get response data on error</span></strong> to continue on an error and get the data:

<img loading="lazy" decoding="async" class="alignnone wp-image-3961 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png" alt="" width="547" height="235" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png 547w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error-300x129.png 300w" sizes="(max-width: 547px) 100vw, 547px" />
<h3>METHOD 2 - Using Connection [Retry Settings]</h3>
Another scenario you may run into is a buggy web server. You ask it to give you some file or data and it, like a snotty kid, just doesn't give it to you! You have to ask twice or thrice before it does its job. If that's the case, you have to retry HTTP requests using <em>Connection</em>:

<img loading="lazy" decoding="async" class="alignnone wp-image-3963 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-3.png" alt="" width="671" height="572" /></div>
<h2>Performance consideration for REST API</h2>
<p>Coming soon&#8230;</p>
<h2>Security consideration for REST API</h2>
<div class="content_block" id="custom_post_widget-3896"><div style="margin-bottom: 1em;">If you need to authenticate or authorize your user to access a web resource, you will need to use one of the <em>Connections:</em></div>
<ul>
 	<li>HTTP</li>
 	<li>OAuth</li>
</ul>
<img loading="lazy" decoding="async" class="wp-image-4078 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png" alt="ZappySys XML Driver - HTTP and OAuth Connection Types" width="577" height="302" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png 577w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252-300x157.png 300w" sizes="(max-width: 577px) 100vw, 577px" />
<h3>HTTP Connection</h3>
<div style="margin-bottom: 1em;">Use <em>HTTP Connection</em> for simple Windows, Basic, NTLM or Kerberos authentication. Just fill in a username and a password and you are good to go!</div>
<div style="margin-bottom: 1em;">You can also use <em>HTTP Connection</em> for more sophisticated authentication like:</div>
<ul>
 	<li><strong>SOAP WSS</strong> (when accessing a SOAP WebService)</li>
 	<li><strong>Static Token / API Key</strong> (when need to pass an API key in HTTP header)</li>
 	<li><strong>Dynamic Token</strong> (same as Static Token method except that each time you need to log in and retrieve a fresh API key)</li>
 	<li><strong>JWT Token</strong> (As per RFC 7519)</li>
</ul>
<img loading="lazy" decoding="async" class="alignnone wp-image-4091 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-1.png" alt="" width="622" height="570" />
<h3>OAuth</h3>
If you are trying to access REST API resource, it is a huge chance, you will need to use <em>OAuth Connection</em>. <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">Read this article</a> to understand how OAuth authentication and authorization works and how to use it (article originally was written for <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>, but the concepts and UI stay the same): <br/>
<a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/</a>
<img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-2.png" width="721" height="708" /></div>
<h2>Conclusion</h2>
<p>Consuming data from JSON files or REST API in Informatica can be challenging but not to worry anymore. Using ZappySys JSON Driver you get most innovative JSON processing engine which not only processes/denormalizes nested JSON but also gives you 100+ Options to cover almost any API processing scenario. You can use this driver to consume data in any ODBC compliant app (i.e. Tableau, Power BI, Excel) and Programming Languages (i.e. C#, Java, Python, PHP). <a href="https://zappysys.com/products/odbc-powerpack/">Click here to Download a FREE trial of ZappySys ODBC PowerPack</a> and learn how to perform JSON / API integration in Informatica without any coding.</p>
<h2>Keywords</h2>
<p>how to import json file in informatica | how to read json file in informatica powercenter | how to test json from informatica | how to use jsaon file as source in informatica power center | how to use json in informatica 10 | informatica how to import data from rest api | informatica jtx to import json file (use of java transformation) | informatica plugin for restful api using json | informatica power center and json support | informatica read json files | informatica rest api | informatica rest api connector | json parser import informatica</p>
<p>The post <a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/">Read JSON in Informatica &#8211; Import REST API / SOAP / JSON File</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Extract / Unload Redshift data into SQL Server using SSIS</title>
		<link>https://zappysys.com/blog/extract-unload-redshift-data-sql-server-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 27 Oct 2015 19:55:36 +0000</pubDate>
				<category><![CDATA[AWS (Amazon Web Services)]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Redshift]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[big data]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[etl]]></category>
		<category><![CDATA[extract]]></category>
		<category><![CDATA[redshift]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=128</guid>

					<description><![CDATA[<p>Introduction In our previous article we saw how to load data into Redshift using SSIS or load data into Redshift using ZappyShell Redshift Command Line In this article we will walk through various steps to Extract/UNLOAD Redshift Data into SQL Server using Amazon S3 Storage Task and ExecuteSQL Task for Amazon Redshift. Below is the [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/extract-unload-redshift-data-sql-server-using-ssis/">Extract / Unload Redshift data into SQL Server using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our previous article we saw <a href="//zappysys.com/posts/sql-server-to-redshift-data-load-using-ssis/">how to load data into Redshift using SSIS</a> or load data into Redshift using ZappyShell <a href="//zappysys.com/products/zappyshell/amazon-redshift-command-line-tools/">Redshift Command Line</a></p>
<p>In this article we will walk through various steps to <em>Extract/UNLOAD Redshift Data into SQL Server</em> using <a href="//zappysys.com/products/ssis-powerpack/ssis-amazon-s3-task/">Amazon S3 Storage Task</a> and <a href="//zappysys.com/products/ssis-powerpack/ssis-redshift-execute-sql-task/">ExecuteSQL Task for Amazon Redshift</a>. Below is the screenshot of actual SSIS Package to <em>Extract Redshift Data and Load into SQL Server</em></p>
<div id="attachment_164" style="width: 664px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/10/extract-unload-redshift-data-load-to-sql-server-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-164" class="size-full wp-image-164" src="//zappysys.com/blog/wp-content/uploads/2015/10/extract-unload-redshift-data-load-to-sql-server-ssis.png" alt="Extract/Unload Redshift Data using SSIS and Load into SQL Server" width="654" height="565" srcset="https://zappysys.com/blog/wp-content/uploads/2015/10/extract-unload-redshift-data-load-to-sql-server-ssis.png 654w, https://zappysys.com/blog/wp-content/uploads/2015/10/extract-unload-redshift-data-load-to-sql-server-ssis-300x259.png 300w" sizes="(max-width: 654px) 100vw, 654px" /></a><p id="caption-attachment-164" class="wp-caption-text">Extract/Unload Redshift Data using SSIS and Load into SQL Server</p></div>
<h2>Requirements for Extract Redshift Data using SSIS</h2>
<p>Before you <a href="http://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html">UNLOAD</a> data from Redshift, you have to make sure few things.</p>
<ol>
<li>Setup your Redshift cluster (Follow these instructions <a href="//zappysys.com/blog/how-to-setup-amazon-redshift-cluster-for-outside-data-access/">to setup redshift cluster</a>)</li>
<li>Load some sample data to Redshift (Red more here: <a href="//zappysys.com/posts/sql-server-to-redshift-data-load-using-ssis/">How to load data to Redshift</a>)</li>
<li>Make sure you have correct connection settings to connect to Redshift cluster (Host name, Port, UserId, Password, DB name etc). You can get host name from AWS Console.</li>
<li>Make sure you have Access to S3 Bucket where files will be dumped from Redshift. You will need AccessKey and SecretKey to fetch files from S3</li>
</ol>
<h2>Step-1: Execute Redshift UNLOAD Command</h2>
<p>Very first step would be to unload redshift data as GZip file using <a href="//zappysys.com/products/ssis-powerpack/ssis-redshift-execute-sql-task/">ExecuteSQL Task for Amazon Redshift</a><br />
Below is SQL Command you can use to <em>extract data from Redshift</em>. Notice how we used variable placeholders in SQL Command. These placeholders are replaced at runtime with actual value stored in specified variable.</p><pre class="crayon-plain-tag">unload ('select * from (select * from customerdata limit 1000)')
to 's3://bw-rstest/stage/custdata'
credentials 'aws_access_key_id={{User::S3Accesskey}};aws_secret_access_key={{User::S3SecretKey}}'
ALLOWOVERWRITE</pre><p>
<b>Export as GZip files (Compressed files)</b></p>
<p>If you exporting data as compressed files to save data transfer cost then use GZIP option as below.</p>
<p><strong>NOTE:</strong> Make sure there are no spaces before and after AccessKey and SecretKey otherwise you may get error.</p><pre class="crayon-plain-tag">unload ('select * from (select * from customerdata limit 1000)')
to 's3://bw-rstest/stage/custdata_file_'
credentials 'aws_access_key_id={{User::S3Accesskey}};aws_secret_access_key={{User::S3SecretKey}}'
ALLOWOVERWRITE
GZIP</pre><p>
<h3>Common Errors / Troubleshooting</h3>
<p><strong>UNLOAD command issue with Region mismatch (S3 bucket vs Redshift Cluster)</strong></p>
<p>If your S3 bucket is in different region than Redshift cluster then above command may fail with &#8220;<em>301 permanent redirect error</em>&#8221; in that case you have to change your S3 bucket region. Region can be changed in AWS console (See S3 bucket properties and change location to match region with Redshift cluster region. Both regions must be same.</p>
<blockquote><p>ERROR: XX000: S3ServiceException:The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.,Status 301,Error PermanentRedirect</p></blockquote>
<p><strong>UNLOAD command issue with accesskey and secret key</strong></p>
<p>If you specify invalid accesskey or secretkey &#8211;or&#8211; you have misspelled keywords related to credentials &#8212; or &#8212; you have spaces before or after accesskey or secret key then you may get following error.</p>
<blockquote><p>ERROR: XX000: Invalid credentials. Must be of the format: credentials &#8216;aws_iam_role=&#8230;&#8217; or &#8216;aws_access_key_id=&#8230;;aws_secret_access_key=&#8230;[;token=&#8230;].</p></blockquote>
<h2>Step-2: Download data files from Amazon S3 Bucket to local machine</h2>
<p>Once files are exported to S3 bucket we can download then to local machine using <a href="//zappysys.com/products/ssis-powerpack/ssis-amazon-s3-task/">Amazon S3 Storage Task</a></p>
<h2>Step-3: Un-compress downloaded files</h2>
<p>If you have exported Redshift data as compressed files (using GZIP option) then you can use <a href="https://zappysys.com/products/ssis-powerpack/ssis-zip-file-task/" target="_blank">ZappySys Zip File task</a> to un-compress multiple files.</p>
<p>Or you can write Script to un-compress those files (see below code). You can skip this step if files are not compressed (not used GZIP option in command).</p>
<p>Here is sample <strong>C# code</strong> to un-compress <strong>GZip</strong> files</p><pre class="crayon-plain-tag">public void Main()
{
	System.IO.DirectoryInfo directorySelected = new System.IO.DirectoryInfo(@"C:\amazon\archive");

	foreach (System.IO.FileInfo fileToDecompress in directorySelected.GetFiles("custdata*_part_*"))
	{
		Decompress(fileToDecompress);
	}

	Dts.TaskResult = (int)ScriptResults.Success;
}
private static void Decompress(System.IO.FileInfo fileToDecompress)
{
	using (System.IO.FileStream originalFileStream = fileToDecompress.OpenRead())
	{
		string currentFileName = fileToDecompress.FullName;
		string newFileName = currentFileName.Remove(currentFileName.Length - fileToDecompress.Extension.Length);

		using (System.IO.FileStream decompressedFileStream = System.IO.File.Create(newFileName))
		{
			using (System.IO.Compression.GZipStream decompressionStream = new System.IO.Compression.GZipStream(originalFileStream, System.IO.Compression.CompressionMode.Decompress))
			{
				decompressionStream.CopyTo(decompressedFileStream);
				//Console.WriteLine("Decompressed: {0}", fileToDecompress.Name);
			}
		}
	}
}</pre><p>
&nbsp;</p>
<h2>Step-4: Loop through files using ForEachLoop Container</h2>
<p>Once files downloaded from S3 bucket we can now loop through files using SSIS ForEach Loop Task and load into SQL Server (One file in each iteration)</p>
<div id="attachment_165" style="width: 705px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/10/ssis-loop-amazon-s3-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-165" class="size-full wp-image-165" src="//zappysys.com/blog/wp-content/uploads/2015/10/ssis-loop-amazon-s3-files.png" alt="Loop through files downloaded from Amazon S3 (Exported using Redshift UNLOAD Command)" width="695" height="384" srcset="https://zappysys.com/blog/wp-content/uploads/2015/10/ssis-loop-amazon-s3-files.png 695w, https://zappysys.com/blog/wp-content/uploads/2015/10/ssis-loop-amazon-s3-files-300x166.png 300w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-165" class="wp-caption-text">Loop through files downloaded from Amazon S3 (Exported using Redshift UNLOAD Command)</p></div>
<h2>Step-5: Data Flow &#8211; Load Redshift Data Files to SQL Server</h2>
<p>Inside data flow you can use Flat File source and OLEDB Destination for SQL Server. Just map correct File columns to SQL Server fields and you should be good. If needed convert Unicode/Non-unicode columns using Data Conversion Transform (This is not needed if source is DT_STR and target also DT_STR.. or source is DT_WSTR and target is DT_WSTR i.e. Unicode).</p>
<h2>Downloads</h2>
<p>To download above SSIS Package click on the below links. In order to test below package you first have to <a href="//zappysys.com/products/ssis-powerpack/">download SSIS PowerPack</a><br />
<a href="//zappysys.com/blog/wp-content/uploads/2015/11/RedshiftExtractDemo_2008.zip">Download Demo SSIS Package &#8211; SSIS 2008</a><br />
<a href="//zappysys.com/blog/wp-content/uploads/2015/11/RedshiftExtractDemo_2012.zip">Download Demo SSIS Package &#8211; SSIS 2012/2014</a></p>
<h2>Conclusion</h2>
<p>amazon Redshift is great way to start your data warehouse projects with very minimum investment in a very simple pay as you go model but loading or unloading data from redshift can be challenging task. Using <a href="//zappysys.com/products/ssis-powerpack/">SSIS PowerPack</a> you can perform Redshift data load or unload in few clicks.</p>
<p>The post <a href="https://zappysys.com/blog/extract-unload-redshift-data-sql-server-using-ssis/">Extract / Unload Redshift data into SQL Server using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
