<?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>HTTP Connection Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/ssis/connection-manager/http/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/ssis/connection-manager/http/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 19 Mar 2026 23:08:10 +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>HTTP Connection Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/ssis/connection-manager/http/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Read Freshdesk data in SSIS &#8211; REST API Call</title>
		<link>https://zappysys.com/blog/read-freshdesk-data-ssis-rest-api-call/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 09 Apr 2019 15:42:16 +0000</pubDate>
				<category><![CDATA[HTTP Connection]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[freshdesk]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6722</guid>

					<description><![CDATA[<p>Introduction In this post we will learn how to read Freshdesk data in SSIS using ZappySys JSON / REST API Source. We will see how to authenticate, paginate / parse and load Freshdesk data into SQL Server Table in just few clicks. If you don&#8217;t use Freshdesk and considering using Zendesk instead then check our previous [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-freshdesk-data-ssis-rest-api-call/">Read Freshdesk data in SSIS &#8211; REST API Call</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/2019/04/freshdesk-logo.png"><img decoding="async" class=" wp-image-6732 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/04/freshdesk-logo.png" alt="" width="146" height="101" /></a>In this post we will learn how to read Freshdesk data in SSIS using <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZappySys JSON / REST API Source</a>. We will see how to authenticate, paginate / parse and load Freshdesk data into SQL Server Table in just few clicks. If you don&#8217;t use Freshdesk and considering using Zendesk instead then check our previous post on how to <a href="https://zappysys.com/blog/read-zendesk-data-in-ssis-call-rest-api/" target="_blank" rel="noopener">Read Zendesk data in SSIS</a>.</p>
<p><a href="https://freshdesk.com" target="_blank" rel="noopener">Freshdesk</a> is a cloud based / managed service like Zendesk to for Support / Customer service.</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Getting Started</h2>
<p>So let&#8217;s get started. We will see step by step instructions to configure Freshdesk API connection, setup JSON Source to read data from Freshdesk and finally load data into SQL Server table. We will use <a href="https://developers.freshdesk.com/api/#list_all_tickets" target="_blank" rel="noopener">List Tickets API</a> in this article for demo purpose but read other useful information on that page if you are new to REST API.</p>
<h3>Setup Freshdesk REST API Connection</h3>
<p>Very first step to call any Freshdesk API in SSIS is to configure HTTP connection (<a href="https://developers.freshdesk.com/api/#authentication">Basic Authentication</a> &#8211; Using UserID/ Password).</p>
<ol>
<li>Open Visual Studio (i.e. SSDT) to create new SSIS Package</li>
<li>From Control Flow SSIS Toolbox drag REST API task</li>
<li>Select URL From HTTP Connection Option from Drop down</li>
<li>Click New HTTP Connection</li>
<li>Configure HTTP connection like below.</li>
<li>Enter any Valid URL (This will be ignored if you Override URL on REST API Task)</li>
<li>Select Basic Authentication (Use User ID and Password)
<div id="attachment_6725" style="width: 1024px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-freshdesk-rest-api-connection.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-6725" class="size-full wp-image-6725" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-freshdesk-rest-api-connection.png" alt="Configure Freshdesk REST API Connection in SSIS - Basic Authentication (User ID / Password)" width="1014" height="705" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-freshdesk-rest-api-connection.png 1014w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-freshdesk-rest-api-connection-300x209.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-freshdesk-rest-api-connection-768x534.png 768w" sizes="(max-width: 1014px) 100vw, 1014px" /></a><p id="caption-attachment-6725" class="wp-caption-text">Configure Freshdesk REST API Connection in SSIS &#8211; Basic Authentication (User ID / Password)</p></div></li>
<li>Click OK to close HTTP Connection</li>
<li>On Main UI of REST API Task, check Use Direct URL and enter below URL (Change YourDomain Part)<br />
https://{your-domain}.freshdesk.com/api/v2/tickets</li>
<li>Click Test Request / Response. If you see OK status then you have successfully called Freshdesk API. That&#8217;s all.
<div id="attachment_6726" style="width: 734px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-call-freshdesk-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6726" class="size-full wp-image-6726" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-call-freshdesk-rest-api.png" alt="Calling Freshdesk REST API in SSIS ( Read Tickets example)" width="724" height="677" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-call-freshdesk-rest-api.png 724w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-call-freshdesk-rest-api-300x281.png 300w" sizes="(max-width: 724px) 100vw, 724px" /></a><p id="caption-attachment-6726" class="wp-caption-text">Calling Freshdesk REST API in SSIS ( Read Tickets example)</p></div></li>
</ol>
<p>In the section we will see how to Parse REST API response and load data into SQL Table.</p>
<h3>Read Freshdesk data in SSIS</h3>
<p>Now let&#8217;s look at steps to configure SSIS JSON Source to read from Freshdesk REST API.</p>
<ol>
<li>Drag Data Flow task from toolbox. Double click to go to Data Flow designer</li>
<li>Drag ZS JSON Source (For File / REST API)</li>
<li>Configure JSON Source like below.</li>
<li>Check Use Connection option and select HTTP connection created in the previous section.</li>
<li>Enter API URL from which you like to read data. In out example we want to read tickets created after 2019-01-01 so we will call API like below. You can skip ?updated_since=2019-01-01 if you like to read all tickets.<br />
<pre class="crayon-plain-tag">https://{your-domain}.freshdesk.com/api/v2/tickets?updated_since=2019-01-01</pre>
</li>
<li>You can also Use <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm" target="_blank" rel="noopener">Variable Placeholder</a> in URL to make things dynamic like below<br />
<pre class="crayon-plain-tag">https://{your-domain}.freshdesk.com/api/v2/tickets?updated_since={{User::MyDateVar,yyyy-MM-dd}}</pre>
</li>
<li>Click Preview to see sample data.
<div id="attachment_6730" style="width: 1116px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-read-freshdesk-data-in-ssis-rest-api-fetch-tickets-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6730" class="size-full wp-image-6730" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-read-freshdesk-data-in-ssis-rest-api-fetch-tickets-example.png" alt="Read Freshdesk data in SSIS - Fetch Tickets example (With REST API pagination)" width="1106" height="799" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-read-freshdesk-data-in-ssis-rest-api-fetch-tickets-example.png 1106w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-read-freshdesk-data-in-ssis-rest-api-fetch-tickets-example-300x217.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-read-freshdesk-data-in-ssis-rest-api-fetch-tickets-example-768x555.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-read-freshdesk-data-in-ssis-rest-api-fetch-tickets-example-1024x740.png 1024w" sizes="(max-width: 1106px) 100vw, 1106px" /></a><p id="caption-attachment-6730" class="wp-caption-text">Read Freshdesk data in SSIS &#8211; Fetch Tickets example (With REST API pagination)</p></div></li>
<li>Configure Pagination like below. Basically you have to select Pagination Mode = <strong>URL Parameter Mode</strong>. Enter Page num indicator as <pre class="crayon-plain-tag">page</pre>
<div id="attachment_6728" style="width: 724px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-rest-api-pagination-url-parameter-mode.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6728" class="size-full wp-image-6728" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-rest-api-pagination-url-parameter-mode.png" alt="Configure REST API pagination (URL Parameter Mode)" width="714" height="210" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-rest-api-pagination-url-parameter-mode.png 714w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-rest-api-pagination-url-parameter-mode-300x88.png 300w" sizes="(max-width: 714px) 100vw, 714px" /></a><p id="caption-attachment-6728" class="wp-caption-text">Configure REST API pagination (URL Parameter Mode)</p></div></li>
<li>Thats it. Now click OK to save UI.</li>
</ol>
<h3>Load Freshdesk data into SQL Server Table</h3>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2>Conclusion</h2>
<p>In this article we saw how easy it is to read data from any REST API service like Freshdesk REST API and load into Relational DB like SQL Server. Try <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack for FREE</a> and explore many other 70+ Tasks /Components not discussed in this article.</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/read-freshdesk-data-ssis-rest-api-call/">Read Freshdesk data in SSIS &#8211; REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Call Oracle UCM Web Service in SSIS (Read XML SOAP API)</title>
		<link>https://zappysys.com/blog/read-write-oracle-ucm-web-service-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 17 Dec 2018 18:32:11 +0000</pubDate>
				<category><![CDATA[HTTP Connection]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS XML Source (File / SOAP)]]></category>
		<category><![CDATA[soap]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5615</guid>

					<description><![CDATA[<p>Introduction In this post we will learn how to access data from Oracle UCM Web Service (Middle layer for WebLogic) and load into SQL Server or any other target. We will use SSIS XML Source to achieve this result. &#160; &#160; About Oracle UCM Web Service If you are not sure what is SOAP Web [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-write-oracle-ucm-web-service-using-ssis/">Call Oracle UCM Web Service in SSIS (Read XML SOAP API)</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/12/oracle-logo.png"><img loading="lazy" decoding="async" class=" wp-image-5682 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/12/oracle-logo.png" alt="" width="110" height="110" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/oracle-logo.png 243w, https://zappysys.com/blog/wp-content/uploads/2018/12/oracle-logo-150x150.png 150w" sizes="(max-width: 110px) 100vw, 110px" /></a>In this post we will learn how to access data from <a href="https://docs.oracle.com/cd/E21764_01/doc.1111/e10807/c12_web_services.htm#CSSDK816" target="_blank" rel="noopener">Oracle UCM Web Service</a> (Middle layer for WebLogic) and load into SQL Server or any other target. We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">SSIS XML Source</a> to achieve this result.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>About Oracle UCM Web Service</h2>
<p>If you are not sure what is SOAP Web Service and how to call in SSIS, First read <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/">this article</a> to understand general concepts of calling SOAP API in SSIS.</p>
<p>UCM Web Service offers <a href="https://docs.oracle.com/cd/E21764_01/doc.1111/e10807/a01_wsdl_and_soap.htm#CSSDK1102" target="_blank" rel="noopener">calling various commands</a>. You have to send XML Request and server will send you XML response with requested data. We will use <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">Array Transformation Technique (Key / Value Pattern)</a> to extract complex nested XML data.</p>
<h2>Step-By-Step</h2>
<p>Now let&#8217;s look at how to call Oracle UCM SOAP API in SSIS.</p>
<h3>Read from Oracle UCM Web Service using XML Source</h3>
<ol>
<li>Drag Data Flow Task in SSIS Designer</li>
<li>Inside Data flow drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">ZS SSIS XML Source</a> from toolbox</li>
<li>First enter URL as below (Replace INSTANCE ID with your own instance)<br />
<pre class="crayon-plain-tag">https://YOUR-INSTANCE-ID.oraclecloud.com/idcws/GenericSoapPort</pre>
</li>
<li>Now Check Use Credentials and select new ZS-HTTP connection</li>
<li>Enter your User ID and Password to call Web Service using Basic Authentication. Click OK to save.
<div id="attachment_5626" style="width: 827px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-oracle-ucm-web-api-connection-settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5626" class="size-full wp-image-5626" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-oracle-ucm-web-api-connection-settings.png" alt="Configure HTTP Connection - Call Oracle UCM Web Service (SOAP XML)" width="817" height="673" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-oracle-ucm-web-api-connection-settings.png 817w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-oracle-ucm-web-api-connection-settings-300x247.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-oracle-ucm-web-api-connection-settings-768x633.png 768w" sizes="(max-width: 817px) 100vw, 817px" /></a><p id="caption-attachment-5626" class="wp-caption-text">Configure HTTP Connection &#8211; Call Oracle UCM Web Service (SOAP XML)</p></div></li>
<li>On XML Source UI Select Content Type = XML (text / xml, charset=UTF-8)</li>
<li>Select Request Method as <strong>POST</strong></li>
<li>Click Enter Raw Edit for HTTP Headers and enter below<br />
<pre class="crayon-plain-tag">SOAPAction: &quot;urn:GenericSoap/GenericSoapOperation&quot;</pre>
</li>
<li>Click on Edit Body and enter your Request Body in XML format.For example to call <strong>GET_SEARCH_RESULTS</strong> service to retrieve the search results for the passed query text you can submit Request Body as below.<br />
<strong>NOTICE:</strong>  String in Search Text was surrounded by backtick (  `  ). Single tick / double quote didn&#8217;t work in our case.<br />
<pre class="crayon-plain-tag">&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ucm="http://www.oracle.com/UCM"&gt;
&lt;soapenv:Body&gt;
  &lt;ucm:GenericRequest webKey="cs"&gt;
    &lt;ucm:Service IdcService="GET_SEARCH_RESULTS"&gt;
      &lt;ucm:Document&gt;
        &lt;ucm:Field name="QueryText"&gt;dDocTitle &amp;lt;starts&amp;gt; `MY_sites_201`&lt;/ucm:Field&gt;
      &lt;/ucm:Document&gt;
    &lt;/ucm:Service&gt;
  &lt;/ucm:GenericRequest&gt;
&lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-read-oracle-ucm-soap-service.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-5625" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-read-oracle-ucm-soap-service.png" alt="" width="975" height="661" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-read-oracle-ucm-soap-service.png 975w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-read-oracle-ucm-soap-service-300x203.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-read-oracle-ucm-soap-service-768x521.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></li>
<li>Now Select Filter (Browse upto Fields under SearchResult node. Once you click OK try to edit your Expression so it looks like below. As you may notice we changed <strong>ResultSet[*]</strong> to <strong>ResultSet[?(@@name==&#8217;SearchResults&#8217;)]</strong><br />
This will ensure that we extract records from only SearchResult Node and not other nodes such as UserAttribInfo or EnterpriseSearchResults<br />
<pre class="crayon-plain-tag">$.env:Envelope.env:Body.ns2:GenericResponse.ns2:Service.ns2:Document.ns2:ResultSet[?(@@name=='SearchResults')].ns2:Row[*]</pre>
<div id="attachment_5624" style="width: 955px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-select-filter.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5624" class="size-full wp-image-5624" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-select-filter.png" alt="Select Filter" width="945" height="390" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-select-filter.png 945w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-select-filter-300x124.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-xml-source-select-filter-768x317.png 768w" sizes="(max-width: 945px) 100vw, 945px" /></a><p id="caption-attachment-5624" class="wp-caption-text">Select Filter</p></div></li>
<li>Now go to 2D Array Tab. Select <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">Key / Value Pattern Option</a>.</li>
<li>Select Column Names / Value Filters as below. You can Use Browse Option to navigate to that field or just type below directly. Below expression will Transform Rows into Column. Foreach attribute name we will get one column.Column Name Filter =&gt;  <strong>$.ns2:Field[*].@name</strong><br />
Column Value Filter =&gt;  <strong>$.ns2:Field[*].#text</strong></li>
<li>Now Click Preview to confirm it works<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-calling-oracle-ucm-web-service-weblogic-soap-api.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-5627" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-calling-oracle-ucm-web-service-weblogic-soap-api.png" alt="" width="842" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-calling-oracle-ucm-web-service-weblogic-soap-api.png 842w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-calling-oracle-ucm-web-service-weblogic-soap-api-300x262.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-calling-oracle-ucm-web-service-weblogic-soap-api-768x670.png 768w" sizes="(max-width: 842px) 100vw, 842px" /></a></li>
<li>That&#8217;s it, you can now click OK to close UI.</li>
</ol>
<h3>Loading Oracle UCM SOAP API data into SQL Server / Other Target</h3>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2>Conclusion</h2>
<p>In this post we saw how easy it is to consume XML SOAP Web Service in SSIS. We called SOAP Service for Oracle UCM Web Service and loaded data into target like SQL Server. You can <a href="https://zappysys.com/products/ssis-powerpack/">download SSIS PowerPack</a> and try many other scenarios like this using 70+ other SSIS Tasks /Components not mentioned in this article.</p>
<p>The post <a href="https://zappysys.com/blog/read-write-oracle-ucm-web-service-using-ssis/">Call Oracle UCM Web Service in SSIS (Read XML SOAP API)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSIS Magento data Read / Write using REST API Call</title>
		<link>https://zappysys.com/blog/ssis-magento-data-read-write-using-rest-api-call/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 01 Nov 2018 16:43:04 +0000</pubDate>
				<category><![CDATA[HTTP Connection]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Connection Manager]]></category>
		<category><![CDATA[SSIS CSV Source]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5267</guid>

					<description><![CDATA[<p>Introduction In this post we will lean SSIS Magento data read / write operations. Magento is a very popular eCommerce platform and they offer JSON based REST API and XML based SOAP API. You can use either API based on your need to automate common integration needs. We recommend using REST API (JSON API) if possible [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-magento-data-read-write-using-rest-api-call/">SSIS Magento data Read / Write using REST API Call</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/11/magento-logo.png"><img loading="lazy" decoding="async" class="wp-image-6392 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/11/magento-logo.png" alt="" width="124" height="112" /></a>In this post we will lean SSIS Magento data read / write operations. Magento is a very popular eCommerce platform and they offer <strong>JSON based REST API</strong> and <strong>XML based SOAP API</strong>. You can use either API based on your need to automate common integration needs.</p>
<p>We recommend using REST API (JSON API) if possible because they are simpler and faster. We will focus only on JSON API in this article but we do have blog post on <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">how to call SOAP API</a>.</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>About Calling Magento REST API</h2>
<p>If you are new to Magento API we highly recommend to get familiar with <a href="https://devdocs.magento.com/guides/v2.3/rest/tutorials/index.html" target="_blank" rel="noopener">Magento REST API here</a>. Magento REST API  offers two ways to authenticate.</p>
<ol>
<li><a href="https://devdocs.magento.com/guides/v2.1/get-started/authentication/gs-authentication-token.html" target="_blank" rel="noopener">Token based Authentication</a></li>
<li><a href="https://devdocs.magento.com/guides/v2.1/get-started/authentication/gs-authentication-oauth.html" target="_blank" rel="noopener">OAuth Based Authentication (OAuth 1.0a)</a></li>
</ol>
<p>In this article we will look at only Token based approach. In token based approach we have to get new token using admin / customer account information.</p>
<p>We will cover later how to access admin or customer level API later in this article (See HTTP connection configuration).</p>
<h2>Configure Connection / Call Magento REST API in SSIS</h2>
<p>Now lets look at very simple example how to use Token based method to call Magento REST API in SSIS. We will first configure HTTP connection and then call REST API.</p>
<p>Let&#8217;s get started.</p>
<ol>
<li>First, open SSIS Package after installing <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a></li>
<li>Drag <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> from SSIS Toolbox on Control Flow Designer. Let&#8217;s rename task to <strong>Get Magento Categories</strong></li>
<li>Enter REST API URL you like to call. For example we can use below URL. Replace **<strong>your-magento-host**</strong> with your own name.<br />
<pre class="crayon-plain-tag">http://**your-magento-host**/index.php/rest/V1/categories</pre>
</li>
<li>Select <strong>Url from Connection</strong> mode</li>
<li>From Connection Dropdown select <strong>new ZS-HTTP</strong> connection
<div id="attachment_5269" style="width: 477px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-connection-rest-api-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5269" class="size-full wp-image-5269" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-connection-rest-api-task.png" alt="Create new connection for SSIS REST API Task" width="467" height="267" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-connection-rest-api-task.png 467w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-connection-rest-api-task-300x172.png 300w" sizes="(max-width: 467px) 100vw, 467px" /></a><p id="caption-attachment-5269" class="wp-caption-text">Create new connection for SSIS REST API Task</p></div></li>
<li>Configure General Tab of HTTP Connection like below<br />
URL can be anything for now because we will use override option in next step (On REST API Task).</li>
<li>Select Credentials Type as <a href="https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/">Dynamic Token</a>.</li>
<li>Enter Userid / password
<div id="attachment_5268" style="width: 730px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5268" class="size-full wp-image-5268" src="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method.png" alt="Configure Magento REST API Connect for Token based Authentication" width="720" height="483" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method.png 720w, https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method-300x201.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-rest-api-call-token-method-272x182.png 272w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-5268" class="wp-caption-text">Configure Magento REST API Connect for Token based Authentication</p></div></li>
<li>Now goto Dynamic Token Tab (Or click <strong>Configure</strong> Link) and configure like below.</li>
<li>Enter Token URL for API Login URL field.<br />
<strong>NOTE</strong>: If you are a customer and want to access your own account (e.g. view your orders) then replace <strong>/admin</strong> with <strong>/customer</strong>  in URL)<br />
Replace <strong>**my-host**</strong> with your host name.<br />
<pre class="crayon-plain-tag">http://***my-host***/index.php/rest/V1/integration/admin/token</pre>
</li>
<li>Change Method to POST.</li>
<li>Enter Body as below (Placeholders are automatically replaced when /token endpoint is called.<br />
<pre class="crayon-plain-tag">{&quot;username&quot;:&quot;[$userid$]&quot;, &quot;password&quot;:&quot;[$password$]&quot;}</pre>
</li>
<li>Select Content Type as Application/Json
<div id="attachment_5270" style="width: 849px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5270" class="size-full wp-image-5270" src="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract.png" alt="Configure Magento Token Request" width="839" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract.png 839w, https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract-300x216.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/configure-magento-dynamic-token-extract-768x552.png 768w" sizes="(max-width: 839px) 100vw, 839px" /></a><p id="caption-attachment-5270" class="wp-caption-text">Configure Magento Token Request</p></div></li>
<li>Now click Dynamic Token &#8211; Response Tab and configure like below.<br />
Select <strong>Regex</strong> and enter Expression as below. This will remove double quotes around token in response.<br />
<pre class="crayon-plain-tag">&quot;(.*)&quot;{{0,1}}</pre>
<div id="attachment_5272" style="width: 541px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/regex-remove-double-quotes-around-value.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5272" class="size-full wp-image-5272" src="https://zappysys.com/blog/wp-content/uploads/2018/11/regex-remove-double-quotes-around-value.png" alt="Extract Token from response - Remove double quotes around value using Regular Expression" width="531" height="385" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/regex-remove-double-quotes-around-value.png 531w, https://zappysys.com/blog/wp-content/uploads/2018/11/regex-remove-double-quotes-around-value-300x218.png 300w" sizes="(max-width: 531px) 100vw, 531px" /></a><p id="caption-attachment-5272" class="wp-caption-text">Extract Token from response &#8211; Remove double quotes around value using Regular Expression</p></div></li>
<li>Click OK to save connection</li>
<li>Now on REST API Task check <strong>Use Direct URL</strong> Option</li>
<li>Click Test Request to confirm its working
<div id="attachment_5273" style="width: 752px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-call-magento-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5273" class="size-full wp-image-5273" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-call-magento-rest-api.png" alt="Call Magento REST API using SSIS REST API Task" width="742" height="701" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-call-magento-rest-api.png 742w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-call-magento-rest-api-300x283.png 300w" sizes="(max-width: 742px) 100vw, 742px" /></a><p id="caption-attachment-5273" class="wp-caption-text">Call Magento REST API using SSIS REST API Task</p></div></li>
</ol>
<p>&nbsp;</p>
<h2>Read data from Magento and Load into SQL Server</h2>
<p>Now lets look at how to read Magento data and load into SQL Server. Assume that you like to read all products.</p>
<h3>Configure JSON Source (Read Magento REST API)</h3>
<ol>
<li>Drag Data flow and double click to edit:
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZS JSON Source</a> on data flow and double click to edit</li>
<li>Configure JSON Source like below if you like to get product list for example
<ol>
<li>Enter URL as below (change http to https if your host support secure channel).<br />
<pre class="crayon-plain-tag">http://***yourhost***/index.php/rest/V1/products?searchCriteria[pageSize]=1000
--- to extract only specific fields do below way --
http://***yourhost***/index.php/rest/V1/products?searchCriteria[pageSize]=1000&amp;fields=items[sku,name]</pre>
</li>
<li>Check Use Credentials. Use same HTTP connection we created in previous section</li>
<li>In the Filter enter <strong>$.items[*]</strong> or click Select Filter to Browse and select items node.</li>
<li>Click Preview to confirm</li>
</ol>
</li>
<li>Here is how your setup will look like after configuration.
<div id="attachment_6525" style="width: 871px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6525" class="size-full wp-image-6525" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api.png" alt="SSIS JSON Source Configuration - Read data from Magento REST API" width="861" height="517" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api.png 861w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api-300x180.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-read-data-rest-api-768x461.png 768w" sizes="(max-width: 861px) 100vw, 861px" /></a><p id="caption-attachment-6525" class="wp-caption-text">SSIS JSON Source Configuration &#8211; Read data from Magento REST API</p></div></li>
<li>If you expecting more than 1000 rows then you have to set up pagination. Now go to <strong>pagination tab</strong> and configure as below (Below options are only available <a href="https://zappysys.com/blog/ssis-powerpack-v2-9-1/" target="_blank" rel="noopener">in v2.9.1 or higher</a>). If you have older version then check next section for workaround.
<ol>
<li>Pagination Mode =<strong>URL Parameter Mode</strong></li>
<li>Page Num Indicator = <strong>searchCriteria[currentPage]</strong></li>
<li>Max Rows Expression = <strong>$.total_count</strong></li>
<li>Page Data Expression = <strong>$.items[*]</strong></li>
</ol>
</li>
<li>Here is how your Magento REST API Pagination Setup will look like.
<div id="attachment_6526" style="width: 578px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/rest-api-pagination-by-max-row-count.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6526" class="size-full wp-image-6526" src="https://zappysys.com/blog/wp-content/uploads/2018/11/rest-api-pagination-by-max-row-count.png" alt="REST API Pagination using Max Row count Mode" width="568" height="376" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/rest-api-pagination-by-max-row-count.png 568w, https://zappysys.com/blog/wp-content/uploads/2018/11/rest-api-pagination-by-max-row-count-300x199.png 300w" sizes="(max-width: 568px) 100vw, 568px" /></a><p id="caption-attachment-6526" class="wp-caption-text">REST API Pagination using Max Row count Mode</p></div></li>
<li>Click OK to save JSON Source. In next section we will see how to load data into Target like SQL Server.</li>
</ol>
<h3>Configure OLEDB Destination (Load into SQL Server)</h3>
<ol>
<li>Drag OLEDB Destination.</li>
<li>Select / Create Connection</li>
<li>Select or create NEW target Table (Click NEW button)</li>
<li>Click Mapping Tab to map source columns to target table</li>
<li>Click OK to save</li>
<li>Execute Package</li>
</ol>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2>Configure Magento Pagination (For Old Version)</h2>
<p>In previous section we configured pagination using newer version (v2.9.1 or higher). But what if you have older version and you dont see that feature. Use below steps for workaround.</p>
<p>Now let&#8217;s look at another common scenario when you real lots of data. Let&#8217;s say you have 5000 products but API call we saw earlier returns max 1000 rows. In that case we have to keep reading next page until all rows are returned. ZappySys provides many settings to configure various REST APIs out there, unfortunately there is no standard around pagination methods. Since Magento API has <a href="https://github.com/magento/magento2/issues/8099" target="_blank" rel="noopener">some bug in API pagination</a> we have to do following hack. Magento keep sending same data of last page if you try to access page which doesn&#8217;t exists. Here is how to overcome that bug.</p>
<h3>Configure REST API task to get total row count</h3>
<p>First step to configure magento pagination is get total rows returned in our request which you like to paginate (in our case <strong>/products</strong>).</p>
<ol>
<li>Go to Control Flow designer</li>
<li>Drag <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> from SSIS Toolbox</li>
<li>Let&#8217;s rename task to <strong>Get Magento Product Count</strong></li>
<li>Double click it and configure like below (Change HTTP to HTTPS if needed)<br />
<pre class="crayon-plain-tag">http://***yourhost***/index.php/rest/V1/products?searchCriteria[pageSize]=10</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-get-magento-result-count-for-pagination.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6387" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-get-magento-result-count-for-pagination.png" alt="" width="734" height="497" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-get-magento-result-count-for-pagination.png 734w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-get-magento-result-count-for-pagination-300x203.png 300w" sizes="(max-width: 734px) 100vw, 734px" /></a></li>
<li>Go to Response Tab and configure like below. Enter expression as $.total_count<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-rest-api-task-save-variable.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6388" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-rest-api-task-save-variable.png" alt="" width="672" height="297" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-rest-api-task-save-variable.png 672w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-rest-api-task-save-variable-300x133.png 300w" sizes="(max-width: 672px) 100vw, 672px" /></a></li>
<li>Click OK to save</li>
</ol>
<p>&nbsp;</p>
<h3>Define Expression for JSON Source &#8211; MaxRows Property</h3>
<p>Now next step is to define expression on MaxRows property of JSON Rows so we stop once all rows consumed from Paginated response. If you don&#8217;t do this it will keep paginating forever 🙁</p>
<ol>
<li>On Control Flow designer <strong>select Data Flow</strong> which contains JSON Source for Magento</li>
<li>Right click and go to Properties of that data flow</li>
<li>Find Expression and click Button to add new expression</li>
<li>On Expression dialogbox select [Your JSON Source].[MaxRows] and for expression enter variable name which holds total count (e.g. <strong>@[User::MaxRows]</strong> )<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-dataflow-expression-json-source-maxrows.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6391" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-dataflow-expression-json-source-maxrows.png" alt="" width="666" height="328" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-dataflow-expression-json-source-maxrows.png 666w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-dataflow-expression-json-source-maxrows-300x148.png 300w" sizes="(max-width: 666px) 100vw, 666px" /></a></li>
<li>Click OK to Save</li>
</ol>
<h3>Configure JSON Source for Magento Pagination</h3>
<p>Now last thing we have to do is go to JSON Source and configure few things for pagination.</p>
<ol>
<li>Go to data flow and double click JSON Source</li>
<li>Click on <strong>Pagination tab</strong> and select Pagination by <strong>URL Parameter Mode</strong></li>
<li>Enter Page name as below<br />
<pre class="crayon-plain-tag">searchCriteria[currentPage]</pre>
</li>
<li>Click OK to save UI</li>
<li>Now <strong>run entire page to test</strong> (NOTE: Do not execute just data flow because if you do that way, it will not extract total row count)<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6394" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination.png" alt="" width="784" height="548" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination.png 784w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination-300x210.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-read-magento-data-rest-api-pagination-768x537.png 768w" sizes="(max-width: 784px) 100vw, 784px" /></a></li>
</ol>
<h2>Write data to Magento using SSIS Web API destination</h2>
<p>Now let&#8217;s look at example to load data into Magento. In below example we will create few sample products.</p>
<ol>
<li>Create new data flow and go to data flow designer</li>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">ZS CSV Source</a> from SSIS toolbox. You can use any Data source but for simple demo we will use it.</li>
<li>Double click CSV source and select Direct Value mode from dropdown. Enter following sample data (Lets create 12 sample products.)<br />
<pre class="crayon-plain-tag">SKU,ProductName
PROD-1,Product 1
PROD-2,Product 2
PROD-3,Product 3
PROD-4,Product 4
PROD-5,Product 5
PROD-6,Product 6
PROD-7,Product 7
PROD-8,Product 8
PROD-9,Product 9
PROD-10,Product 10
PROD-11,Product 11
PROD-12,Product 12</pre>
</li>
<li>Now click OK to save UI</li>
<li>Now drag <strong>ZS Template Transform</strong> from toolbox.</li>
<li>Connect CSV Source to Template Transform</li>
<li>Enter following sample text to build request for new product. Refer to <a href="https://devdocs.magento.com/guides/v2.3/rest/tutorials/configurable-product/create-simple-products.html">Magento API help file / tutorial</a> to learn more.<br />
<pre class="crayon-plain-tag">{
  "product": {
    "sku": "&lt;%SKU%&gt;",
    "name": "&lt;%ProductName%&gt;",
    "attribute_set_id": 4,
    "price": 25,
    "status": 1,
    "visibility": 1
   }
}</pre>
</li>
<li>Notice that when you click <strong>Insert Variable</strong> &gt; <strong>Columns</strong> &gt; select desired upstream column placeholder. You can also encode special characters in your data (e.g. new lines) using function like &lt;%MyColumn,JSONENCODE%&gt;<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-create-new-product-api-request-template-transform.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6389" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-create-new-product-api-request-template-transform.png" alt="" width="729" height="493" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-create-new-product-api-request-template-transform.png 729w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-magento-create-new-product-api-request-template-transform-300x203.png 300w" sizes="(max-width: 729px) 100vw, 729px" /></a></li>
<li>Click OK and save UI</li>
<li>Now drag ZS Web API Destination from SSIS Toolbox. Configure like below.Enter URL same as before (used to read product), change Method to <strong>POST</strong>, change content type to Application/JSON.<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-6390" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api.png" alt="" width="778" height="660" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api.png 778w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api-300x254.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/ssis-create-new-product-records-magento-call-rest-api-768x652.png 768w" sizes="(max-width: 778px) 100vw, 778px" /></a></li>
<li>Now run entire flow (You can watch your API <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">requests in Fiddler</a> for debugging)</li>
</ol>
<h2>Debug Magento Web Requests using Fiddler</h2>
<p>Click on below article to learn how to debug web requests</p>
<blockquote class="wp-embedded-content" data-secret="dKZ26bWM7i"><p><a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/">How to use Fiddler to analyze HTTP Web Requests</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" src="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/embed/#?secret=dKZ26bWM7i" data-secret="dKZ26bWM7i" width="600" height="338" title="&#8220;How to use Fiddler to analyze HTTP Web Requests&#8221; &#8212; ZappySys Blog" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
<h2>Magento Integration in Other Apps (e.g. Power BI / Informatica / SQL Server)</h2>
<p>You can use techniques listed on this page with <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ODBC Drivers</a> too for integration in other tools like Power BI, SQL Server code, Informatica etc.</p>
<h2>Conclusion</h2>
<p>In this post we saw how easy it is to perform Magento Integration in SSIS without doing any programming. In few steps you can read or write data in Magento using <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack</a> REST API components. Download FREE Trial and explore many other scenarios.</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/ssis-magento-data-read-write-using-rest-api-call/">SSIS Magento data Read / Write using REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read data from Splunk in SSIS</title>
		<link>https://zappysys.com/blog/read-data-splunk-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 29 Sep 2018 11:35:54 +0000</pubDate>
				<category><![CDATA[HTTP Connection]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Connection Manager]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[oauth2]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[splunk]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4979</guid>

					<description><![CDATA[<p>Introduction Splunk is commonly used for searching, monitoring, and analyzing machine-generated big data, via a Web-style interface. In this post, you will learn how to implement Splunk API Integration with SQL Server or any other RDBMS (e.g. Oracle, MySQL, Postgresql) using SSIS in a few clicks. We will use SSIS XML Source to Read data from Splunk and Load into SQL Server / other [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-data-splunk-ssis/">How to read data from Splunk in SSIS</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/09/splunk-logo.png"><img loading="lazy" decoding="async" class="alignleft size-thumbnail wp-image-4980" src="https://zappysys.com/blog/wp-content/uploads/2018/09/splunk-logo-150x150.png" alt="Splunk Logo" width="150" height="150" /></a>Splunk is commonly used for searching, monitoring, and analyzing machine-generated big data, via a Web-style interface. In this post, you will learn how to implement <a href="http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTprolog" target="_blank" rel="noopener">Splunk API</a> Integration with SQL Server or any other RDBMS (e.g. Oracle, MySQL, Postgresql) using <strong>SSIS</strong> in a few clicks. We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">SSIS XML Source</a> to <strong>Read data from Splunk</strong> and Load into SQL Server / other targets (Using HTTP Connection).</p>
<p>We will discuss on How to Create an Intuit Developer Account, How to Create QuickBooks Online App for OAuth, We will also discuss reverse scenario to <strong>Write data to Splunk</strong> (API POST for Insert or Update in Splunk) using <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">SSIS REST API Task</a></p>
<p>In nutshell, this post will focus on how to call Splunk API using SSIS.<br />
So let’s get started.</p>
<h2></h2>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>What is Splunk</h2>
<p>Splunk is a software platform to search, analyze and visualize the machine-generated data gathered from the websites, applications, sensors, devices etc. which make up your IT infrastructure and business.</p>
<p>The other benefits of implementing Splunk are:</p>
<ul>
<li>Input data can be in any format for e.g. .csv, or JSON or other formats</li>
<li>Give Alerts / Events notification at the onset of a machine state</li>
<li>Accurately predict the resources needed for scaling up the infrastructure</li>
<li>Create knowledge objects for Operational Intelligence</li>
</ul>
<h2>Why Use Splunk REST API</h2>
<p>So there will be a time when you want to automate certain things without using Splunk Web Portal. Here are some example scenarios which can be solved using <a href="http://dev.splunk.com/restapi" target="_blank" rel="noopener">the Splunk REST API</a>.</p>
<ul>
<li>Reading/Update Splunk configuration files</li>
<li>Creating Splunk searches using the REST API</li>
<li>Create a new Splunk object for a specific context</li>
<li>Edit a Splunk object</li>
</ul>
<h2>Step-By-Step &#8211; Import Splunk data into SQL Server</h2>
<p>In order to start, we will show several examples. ZappySys includes an <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/">SSIS XML Source</a> that will help you to call Splunk API, read search job results data from Splunk with SSIS, create a new Saved Search on Splunk with SSIS and do many more actions using REST API. To learn more about Splunk REST API <a href="http://dev.splunk.com/restapi" rel="noopener">check this help file</a>.</p>
<p>To get Splunk data using the REST API call, you need to have a Free or Licensed Splunk Account. You can Download Splunk Enterprise or Register with Splunk <a href="https://www.splunk.com/en_us/download.html">see this link.</a> You can find the videos for <strong>How to Install</strong> and <strong>Getting Data in</strong> on this link: <a href="https://www.splunk.com/en_us/training/videos/all-videos.html" target="_blank" rel="noopener">Splunk Enterprise Videos</a>.</p>
<h3>Create / Configure Splunk Dataset</h3>
<p>So first step in our demo would be make sure we have at least one Splunk Dataset which we can query using REST API. If you have already configured Dataset then skip this section.</p>
<ol>
<li>First of all, let&#8217;s start the Splunk on your machine from the program menu.
<div id="attachment_6225" style="width: 402px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-start-splunk.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6225" class="wp-image-6225 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-start-splunk.png" alt="ssis-start-splunk" width="392" height="622" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-start-splunk.png 392w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-start-splunk-189x300.png 189w" sizes="(max-width: 392px) 100vw, 392px" /></a><p id="caption-attachment-6225" class="wp-caption-text">Start Splunk</p></div></li>
<li>Hence, Splunk opens into the browser. So let&#8217;s logged in and let&#8217;s Add Data for WinEvents to be searched in our next phase.
<div id="attachment_6226" style="width: 921px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-add-data-click.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6226" class="wp-image-6226 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-add-data-click-e1550857291681.png" alt="ssis-splunk-add-data-click" width="911" height="439" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-add-data-click-e1550857291681.png 911w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-add-data-click-e1550857291681-300x145.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-add-data-click-e1550857291681-768x370.png 768w" sizes="(max-width: 911px) 100vw, 911px" /></a><p id="caption-attachment-6226" class="wp-caption-text">Add Data</p></div></li>
<li>To start adding data first, choose a data source. For example, you can monitor WinEvents.
<div id="attachment_6227" style="width: 568px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-moniter-data-click.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6227" class="wp-image-6227 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-moniter-data-click-e1550857375668.png" alt="ssis-splunk-moniter-data-click" width="558" height="337" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-moniter-data-click-e1550857375668.png 558w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-moniter-data-click-e1550857375668-300x181.png 300w" sizes="(max-width: 558px) 100vw, 558px" /></a><p id="caption-attachment-6227" class="wp-caption-text">Select Data Source</p></div></li>
<li>Select Search &amp; Reporting in App Context and click next for review and click next to finish.
<div id="attachment_6228" style="width: 993px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-select-search-and-reporting.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6228" class="wp-image-6228 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-select-search-and-reporting-e1550857445835.png" alt="ssis-splunk-select-search-and-reporting" width="983" height="423" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-select-search-and-reporting-e1550857445835.png 983w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-select-search-and-reporting-e1550857445835-300x129.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-select-search-and-reporting-e1550857445835-768x330.png 768w" sizes="(max-width: 983px) 100vw, 983px" /></a><p id="caption-attachment-6228" class="wp-caption-text">Select Search &amp; Reporting</p></div></li>
<li>That&#8217;s it local event logs input has been created successfully for searching.
<div id="attachment_6229" style="width: 914px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-start-searching-local-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6229" class="wp-image-6229 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-start-searching-local-source-e1550857538570.png" alt="ssis-splunk-start-searching-local-source" width="904" height="640" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-start-searching-local-source-e1550857538570.png 904w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-start-searching-local-source-e1550857538570-300x212.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-start-searching-local-source-e1550857538570-768x544.png 768w" sizes="(max-width: 904px) 100vw, 904px" /></a><p id="caption-attachment-6229" class="wp-caption-text">Start searching for local events</p></div></li>
<li>Therefore you will redirect to search page.
<div id="attachment_6230" style="width: 1202px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-page.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6230" class="wp-image-6230 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-page-e1550857659614.png" alt="ssis-splunk-search-page" width="1192" height="692" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-page-e1550857659614.png 1192w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-page-e1550857659614-300x174.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-page-e1550857659614-768x446.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-page-e1550857659614-1024x594.png 1024w" sizes="(max-width: 1192px) 100vw, 1192px" /></a><p id="caption-attachment-6230" class="wp-caption-text">Splunk search page</p></div></li>
<li>So, let&#8217;s import WinEvents search data into SQL Server in the next few sections.</li>
</ol>
<p>&nbsp;</p>
<h3>Connect to Splunk in SSIS / Create Search JOB / Obtain JobID</h3>
<p>Now once you have Splunk Dataset configured, next step is Call Splunk API. So most common thing you will do with splunk API is to call splunk search API. In splunk Search API is Job Style API means you perform following steps</p>
<ol>
<li>First call /services/search/jobs/ endpoint with Search query (in POST) to create search Job. It returns you Job ID (also known as <strong>SID</strong>)</li>
<li>Wait until Job is done (This part may be tricky) &#8230; SO you may have to add timer task after first step and in the 3rd step enable Retry option on HTTP connection just incase it didnt finish within supplied delay.</li>
<li>Once Job finished you can read by calling below API endpoint.<br />
/services/search/jobs/{{your Job Id}}/results?output_mode=json</li>
</ol>
<p>Thats it now let&#8217;s look at actual steps</p>
<ol>
<li>Now let&#8217;s make the first call to search job using a POST method. If you are using a custom time range, pass it in with the POST request. Refer this link for more information: <a href="https://docs.splunk.com/Documentation/Splunk/7.2.3/Search/ExportdatausingRESTAPI" target="_blank" rel="noopener">Export data using the Splunk REST API</a>. If your URL is different than below HTTP connection then Check <strong>Use direct URL</strong> option on REST API Task and enter custom URL.<br />
<pre class="crayon-plain-tag">URL:
https://localhost:8089/services/search/jobs/

Post Reuest Data:
search=search source="WinEventLog:*" host="SCIFI08" earliest=-1d&amp;output_mode=json</pre>
<div id="attachment_6309" style="width: 1579px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-post-call.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6309" class="wp-image-6309 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-post-call.png" alt="ssis-splunk-search-post-call" width="1569" height="714" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-post-call.png 1569w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-post-call-300x137.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-post-call-768x349.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-search-post-call-1024x466.png 1024w" sizes="(max-width: 1569px) 100vw, 1569px" /></a><p id="caption-attachment-6309" class="wp-caption-text">Splunk POST Search request</p></div></li>
<li>So let&#8217;s get Response SID(Search job ID) into the variable to be used in the next call to get results.
<div id="attachment_6311" style="width: 1182px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-sid-in-variable.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6311" class="wp-image-6311 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-sid-in-variable.png" alt="ssis-splunk-get-sid-in-variable" width="1172" height="659" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-sid-in-variable.png 1172w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-sid-in-variable-300x169.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-sid-in-variable-768x432.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-sid-in-variable-1024x576.png 1024w" sizes="(max-width: 1172px) 100vw, 1172px" /></a><p id="caption-attachment-6311" class="wp-caption-text">Store Splunk Response Search Job ID in a variable</p></div></li>
<li>Now add the Data Flow Task to retrieve Splunk search result data using JSON Source (REST API or File) in it. In below URL we are specifying <strong>count=5</strong> but in real world change it to 100 or higher.<br />
<pre class="crayon-plain-tag">TO Get Metadata deatils:
https://localhost:8089/services/search/jobs/1549701697.1424/results?output_mode=json&amp;offset=0&amp;count=5</pre>
<div id="attachment_6314" style="width: 1335px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-results-meta.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6314" class="wp-image-6314 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-results-meta.png" alt="ssis-splunk-get-results-meta" width="1325" height="733" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-results-meta.png 1325w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-results-meta-300x166.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-results-meta-768x425.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-get-results-meta-1024x566.png 1024w" sizes="(max-width: 1325px) 100vw, 1325px" /></a><p id="caption-attachment-6314" class="wp-caption-text">Splunk Search JSON Results Data</p></div></li>
<li>Furthermore, Let&#8217;s set pagination to get all the results data.<div class="su-note"  style="border-color:#e5de9d;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:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">NOTE: In below screenshot we are specifying count=5 and Increment=5 just to show demo but in real world set both items to higher value (e.g. 100) so you request more records per page.</div></div>
<div id="attachment_6319" style="width: 814px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-pagination.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6319" class="wp-image-6319 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-pagination.png" alt="ssis-splunk-set-pagination" width="804" height="860" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-pagination.png 804w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-pagination-280x300.png 280w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-pagination-768x821.png 768w" sizes="(max-width: 804px) 100vw, 804px" /></a><p id="caption-attachment-6319" class="wp-caption-text">Set Pagination</p></div></li>
<li>Let&#8217;s preview the results data.
<div id="attachment_6316" style="width: 1045px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-preview-results.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6316" class="wp-image-6316 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-preview-results-e1550857742506.png" alt="Preview Splunk Search Data" width="1035" height="725" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-preview-results-e1550857742506.png 1035w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-preview-results-e1550857742506-300x210.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-preview-results-e1550857742506-768x538.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-preview-results-e1550857742506-1024x717.png 1024w" sizes="(max-width: 1035px) 100vw, 1035px" /></a><p id="caption-attachment-6316" class="wp-caption-text">Preview Splunk Search Data</p></div></li>
<li>Edit JSON Source again and replace the below URL with it to get results By SID(Search Job ID) variable. And create the new HTTP connection as if the search job(SID) is newly created, it is possible that we will #get 204s(No Content) until the job is ready to respond.<br />
<pre class="crayon-plain-tag">https://localhost:8089/services/search/jobs/{{User::v_sid}}/results?output_mode=json&amp;offset=0&amp;count=5</pre>
<div id="attachment_6342" style="width: 1505px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-204-handling.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6342" class="wp-image-6342 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-204-handling.png" alt="ssis-splunk-204-handling" width="1495" height="731" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-204-handling.png 1495w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-204-handling-300x147.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-204-handling-768x376.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-204-handling-1024x501.png 1024w" sizes="(max-width: 1495px) 100vw, 1495px" /></a><p id="caption-attachment-6342" class="wp-caption-text">204 No Content response error handling</p></div></li>
<li>Furthermore, click on OK button and make sure we need to <strong><strong>click on NO.</strong></strong>
<div id="attachment_6343" style="width: 836px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-variable-url.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6343" class="wp-image-6343 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-variable-url.png" alt="ssis-splunk-set-variable-url" width="826" height="733" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-variable-url.png 826w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-variable-url-300x266.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-splunk-set-variable-url-768x682.png 768w" sizes="(max-width: 826px) 100vw, 826px" /></a><p id="caption-attachment-6343" class="wp-caption-text">Splunk URL With variable</p></div></li>
<li>Finally, we are ready to Load Splunk data into the SQL Server.</li>
</ol>
<h3>Load Splunk data into SQL Server</h3>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>Above all, in this blog, we learned how to read Splunk data in SSIS. Furthermore we used <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/">XML Source Component</a> and <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">SSIS REST API Task</a> to call Splunk REST API and load data into SQL server. You can <a href="https://zappysys.com/products/ssis-powerpack/">download SSIS PowerPack here</a> to try many other scenarios not discussed in this blog along with 70+ other components.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following links for more information about the use of Splunk Online REST API with our tools:</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">REST API Task</a>, you can also find <a href="https://youtu.be/jPdcQlWOBZA">Tutorial Video</a> here.</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/">XML Source Component</a>, you can also find <a href="https://youtu.be/2Li6Vy-nQvw">Tutorial Video</a> here.</li>
<li><strong>Help File:</strong> Documentation of <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-rest-api-web-service-task.htm">REST API Task</a> and <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-xml-source.htm">XML Source Component</a>.</li>
</ul>
<p>The post <a href="https://zappysys.com/blog/read-data-splunk-ssis/">How to read data from Splunk in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to call SOAP / REST API using Dynamic Token in SSIS / ODBC</title>
		<link>https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 07 Jul 2018 09:03:41 +0000</pubDate>
				<category><![CDATA[HTTP Connection]]></category>
		<category><![CDATA[SSIS XML Source (File / SOAP)]]></category>
		<category><![CDATA[jsonpath]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[xpath]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4378</guid>

					<description><![CDATA[<p>Introduction In this blog, we will learn how to call SOAP / REST API using Dynamic Token in SSIS (i.e. Two steps authentication approach &#8211; Fist Call Login API to get token and then call API). In our previous blog post, we saw how to call Web API using some industry standards approaches, such as [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/">How to call SOAP / REST API using Dynamic Token in SSIS / ODBC</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/06/REST-API-icon.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-4254 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/06/REST-API-icon.jpg" alt="Logo REST API" width="217" height="232" /></a>In this blog, we will learn how to call SOAP / REST API using Dynamic Token in SSIS (i.e. Two steps authentication approach &#8211; Fist Call Login API to get token and then call API).</p>
<p>In our previous blog post, we saw how to call Web API using some industry standards approaches, such as <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">OAuth 2.0 Authorization</a> or <a href="https://zappysys.com/blog/how-to-set-base64-encoded-authorization-header-for-http-web-request/" target="_blank" rel="noopener">Basic Authorization</a>. However, not all APIs follow the industry standard to authenticate API requests. After talking with many customers we noticed that very common non-standard technique to authenticate API is Dynamic Token Approach. In this approach first, you have to call Login request to get a temporary token (i.e. sessionid ). Once you get that temp token you can supply it along with your API requests. These temp token/session id usually expires in short time (i.e. expire in one hour or so).</p>
<p>Sounds complicated? Well not really if you use ZappySys <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> or <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ODBC Drivers for API</a>. In this post, we will go through the steps, to authenticate using Dynamic Token approach. We will show you features of  <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm">ZappySys SSIS HTTP Connection Manager</a>. For example purpose, we will call XML SOAP API using <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/">SSIS XML Source Connector</a> but same concepts can be applied to read from JSON API using  <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/">SSIS JSON Source Connector</a> or CSV API using <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">CSV Source Connector</a>.</p>
<p>So let&#8217;s get started.</p>
<h2></h2>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Getting Started</h2>
<p>In order to start, we will show several examples. ZappySys includes an <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/">SSIS XML Source Connector</a> and  <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/">SSIS JSON Source Connector</a> that will help you to call SOAP / REST API, read various data from SOAP / REST API with SSIS.</p>
<p>To get token from login / authentication URL you have to gather a few pieces from your API documentation.</p>
<ul>
<li>How to call Login API for your API &#8211; (This is not the same URL as Vendor Site Login Page, but its usually API Login endpoint e.g. https://somecompany/api/v2/login)</li>
<li>API Response Format (e.g. JSON, XML ,CSV or Random Text )</li>
</ul>
<p>In our below example steps, we will use XML API which requires POST method first to pass Userid / password to authenticate. If Authentication is successful it may return a response in XML format which contains token.</p>
<p>In the next step, we will call other API (e.g. get-data) and pass token as Authorization Header. All these steps will be done automatically using  <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm">ZappySys SSIS HTTP Connection Manager</a>.</p>
<h2>Create HTTP Connection for Dynamic Token</h2>
<p>To get API response data using SOAP / REST API call, you need to get an API Token from your login request URL. I am using ZappySys sample SOAP API to show you for the Demo purpose. Follow the steps mentioned below to get API Token:</p>
<h3>Create in SSIS</h3>
<ol>
<li>Right Click on Connection Managers Window, and one Context menu appears for creating a new connection manager.
<div id="attachment_10775" style="width: 742px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/Select-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10775" class="size-full wp-image-10775" src="https://zappysys.com/blog/wp-content/uploads/2018/07/Select-connection.png" alt="Select new connection" width="732" height="446" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/Select-connection.png 732w, https://zappysys.com/blog/wp-content/uploads/2018/07/Select-connection-300x183.png 300w" sizes="(max-width: 732px) 100vw, 732px" /></a><p id="caption-attachment-10775" class="wp-caption-text">Connection Manager Window: Create New Connection</p></div>
<div class="mceTemp"></div>
</li>
<li>Select ZS HTTP Connection Manager from the list of Connection Managers and, double-click on it or click on Add button to add a new Connection Manager. By Default, The created connection manager is of Package-Level. You can set Project Level Connection manager too If you want.
<div id="attachment_10776" style="width: 486px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/Select-HTTP-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10776" class="size-full wp-image-10776" src="https://zappysys.com/blog/wp-content/uploads/2018/07/Select-HTTP-connection.png" alt="Connection list from SSIS" width="476" height="487" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/Select-HTTP-connection.png 476w, https://zappysys.com/blog/wp-content/uploads/2018/07/Select-HTTP-connection-293x300.png 293w" sizes="(max-width: 476px) 100vw, 476px" /></a><p id="caption-attachment-10776" class="wp-caption-text">List of SSIS Connection Managers – Select HTTP Connection Manager</p></div></li>
</ol>
<h3>Create in ODBC</h3>
<p>To use HTTP Connection in ODBC Drivers you can change connection Type to HTTP like below and it will show similar UI discussed in this article.</p>
<div id="attachment_10777" style="width: 814px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/Create-HTTP-connection-in-ODBC.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10777" class="size-full wp-image-10777" src="https://zappysys.com/blog/wp-content/uploads/2018/07/Create-HTTP-connection-in-ODBC.png" alt="New HTTP connection in ODBC" width="804" height="522" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/Create-HTTP-connection-in-ODBC.png 804w, https://zappysys.com/blog/wp-content/uploads/2018/07/Create-HTTP-connection-in-ODBC-300x195.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/Create-HTTP-connection-in-ODBC-768x499.png 768w" sizes="(max-width: 804px) 100vw, 804px" /></a><p id="caption-attachment-10777" class="wp-caption-text">Create an HTTP connection inside an ODBC driver</p></div>
<h2>Configure HTTP Connection Credential Type</h2>
<p>Once you add new SSIS ZS HTTP Connection Manager, Go to General Tab and Configure HTTP Connection Manager for Two Step Authorization Flow. Enter API URL, Login Credentials, and configure some basic settings for the same. We used Login URL as just example but you can enter any valid API URL endpoint here. Actual Login URL goes on Dynamic Token Tab (see next step)</p>
<div id="attachment_10778" style="width: 628px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-general-tab.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10778" class="size-full wp-image-10778" src="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-general-tab.png" alt="HTTP connection with dynamic token in ODBC" width="618" height="515" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-general-tab.png 618w, https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-general-tab-300x250.png 300w" sizes="(max-width: 618px) 100vw, 618px" /></a><p id="caption-attachment-10778" class="wp-caption-text">SSIS ZS HTTP Connection Manager: General Tab Configurations Settings</p></div>
<h2>Configure Request Settings</h2>
<p>Once you enter Username / password details on General Tab now we need to setup some information like Login Request URL, Body, Headers. Lets look at few options.</p>
<h3><strong>Passing User ID /Password in Body</strong></h3>
<ol>
<li>Go to Dynamic Token tab, Enter the following pieces.
<ol>
<li>Token/API Login URL<br />
For our example enter API Login URL as:<br />
<pre class="crayon-plain-tag">https://zappysys.com/downloads/files/test/soap-login.aspx</pre></li>
<li>Request Method as <strong>POST</strong></li>
<li>Request Body as below. Notice we used <pre class="crayon-plain-tag">[$userid$]</pre>  and <pre class="crayon-plain-tag">[$password$]</pre>  placeholders. These are replaced automatically at runtime so you do not have to hard code in Body and keep it secure. (See General Tab to enter UserID/Password)<br />
<strong>Pass User ID / Password in Body</strong><br />
<pre class="crayon-plain-tag">&lt;soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:urn=""urn:partner.soap.sforce.com""&gt;
   &lt;soapenv:Body&gt;
      &lt;urn:login&gt;
         &lt;urn:username&gt;[$userid$]&lt;/urn:username&gt;
         &lt;urn:password&gt;[$password$]&lt;/urn:password&gt;
      &lt;/urn:login&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
</li>
<li>Select Request Body Content Type. For JSON data it may be application/json. For Key/Value Pair  <strong>key1=value1&amp;key2=value2</strong> leave it Default.<strong>Passing User ID /Password in Request BODY</strong>
<div id="attachment_10779" style="width: 858px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-configuration-tab.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10779" class="size-full wp-image-10779" src="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-configuration-tab.png" alt="HTTP connection dynamic tab" width="848" height="797" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-configuration-tab.png 848w, https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-configuration-tab-300x282.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-configuration-tab-768x722.png 768w" sizes="(max-width: 848px) 100vw, 848px" /></a><p id="caption-attachment-10779" class="wp-caption-text">SSIS ZS HTTP Connection Manager: Dynamic Token Tab Configurations Settings of Request Tab</p></div></li>
</ol>
</li>
</ol>
<h3><strong>Passing User ID / Password in URL (GET Request)</strong></h3>
<p>Our Example API pass credentials in the <strong>POST</strong> body but some API may pass via URL as <strong>GET</strong> request.</p>
<p>In such case, you can enter like this<br />
<pre class="crayon-plain-tag">https://mysite.com/api/v2/login?userid=[$userid$]&amp;password=[$password$]</pre>
Notice in above URL we used <pre class="crayon-plain-tag">[$userid$]</pre>  and <pre class="crayon-plain-tag">[$password$]</pre>   placeholders. These are replaced automatically at runtime (See General Tab to enter UserID/Password)</p>
<h3><strong>Passing User ID /Password in Header as Basic Authentication</strong></h3>
<p>Another scenario is API requires <a href="https://zappysys.com/blog/how-to-set-base64-encoded-authorization-header-for-http-web-request/" target="_blank" rel="noopener">HTTP Basic authentication</a>, (Pass User ID / Password in Header as Base64 encoded value) then you can pass credentials like this:</p>
<p><code style="margin-bottom: 10pt;">Authorization: Basic &lt;&lt;[$userid$]:[$password$],FUN_BASE64ENC&gt;&gt;<br />
</code></p>
<p>Here we have used <code style="margin-bottom: 10pt;">FUN_BASE64ENC</code> function but there are <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm" target="_blank" rel="noopener">many other functions</a> can be used anywhere in Body or Headers</p>
<div id="attachment_10780" style="width: 652px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-configuration-header-ODBC.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10780" class="size-full wp-image-10780" src="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-configuration-header-ODBC.png" alt="HTTP connection dynamic token in header request credentials" width="642" height="512" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-configuration-header-ODBC.png 642w, https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-configuration-header-ODBC-300x239.png 300w" sizes="(max-width: 642px) 100vw, 642px" /></a><p id="caption-attachment-10780" class="wp-caption-text">Using Basic Authentication in Dynamic Token approach</p></div>
<h2>Configure Response Settings</h2>
<p>Now lets configure how to extract token (single value) from response. Which can be XML, JSON or sometimes Raw Text. We support 4 modes (default = None means full response text is treated as token). If you want to extract just single value and not full text then use below settings.</p>
<h3>XML Expression Type (Use XPath)</h3>
<ol>
<li>Now, Go to Response Settings tab under a Dynamic Token tab, Enter Response Settings like Token Extract Mode, Expression Type, Content Filter Expression as below XPath Expression. The expression basically extracts content from sessionid XML node using below <a href="https://zappysys.com/blog/ssis-extract-single-xml-node-using-xpath-soap-response/" target="_blank" rel="noopener">XPath Expression</a>.<pre class="crayon-plain-tag">//*[local-name()='sessionid']</pre>
<div id="attachment_10781" style="width: 650px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10781" class="size-full wp-image-10781" src="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab.png" alt="Get XML response for dynamic token" width="640" height="510" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab.png 640w, https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-300x239.png 300w" sizes="(max-width: 640px) 100vw, 640px" /></a><p id="caption-attachment-10781" class="wp-caption-text">ODBC ZS HTTP Connection Manager: Dynamic Token Tab Configurations Settings of Response Tab</p></div></li>
<li>That&#8217;s it click on OK button to save your Connection Manager Configurations.</li>
</ol>
<h3>JSON Expression Type (Use JSONPath)</h3>
<p>If you API returns JSON response (like <a href="https://zappysys.com/blog/read-walmart-api-data-ssis-odbc/">Walmart API Example</a>) then you can do something like below. Choose Expression Type=JSON and in Response Content Filter You can enter expression like $.some_property_name  (e.g. $.access_token). Check more about How to write <a href="https://zappysys.com/blog/jsonpath-examples-expression-cheetsheet/">JSON Path expression here</a>.</p>
<div id="attachment_10782" style="width: 793px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-SSIS.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10782" class="size-full wp-image-10782" src="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-SSIS.png" alt="Walmart API – Extract Token – Response Settings" width="783" height="646" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-SSIS.png 783w, https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-SSIS-300x248.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-SSIS-768x634.png 768w" sizes="(max-width: 783px) 100vw, 783px" /></a><p id="caption-attachment-10782" class="wp-caption-text">SSIS ZS HTTP Connection Manager &#8211; Get a JSON response for the token</p></div>
<h3>Regular Expression Type (Use Regex)</h3>
<p>Another advanced mode to extract token from response is Regex Mode. You can write any valid regular expression <a href="https://zappysys.com/blog/using-regular-expressions-in-ssis/" target="_blank" rel="noopener">like this one</a> to extract just one value.</p>
<p>For example if your response returns raw string with token in double quotes but you want just token and no double quotes around it then try something like below.</p>
<div id="attachment_10783" style="width: 793px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-regex-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10783" class="size-full wp-image-10783" src="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-regex-example.png" alt="Dynamic token from a regex expression" width="783" height="646" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-regex-example.png 783w, https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-regex-example-300x248.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/HTTP-connection-dynamic-token-response-settings-tab-regex-example-768x634.png 768w" sizes="(max-width: 783px) 100vw, 783px" /></a><p id="caption-attachment-10783" class="wp-caption-text">Extract Token from response – Remove double quotes around value using Regular Expression</p></div>
<h2><strong>Call API </strong><strong>in SSIS with </strong><strong>Dynamic API Token</strong></h2>
<p>Now once you have setup HTTP connection manager to authenticate and get API token, we are ready for next step. Now we can use that token in SOAP / REST API Service call. So, let&#8217;s move to the SSIS Part.</p>
<ol>
<li>Once SSIS Package is open, Goto Data Flow Section, For that Drag and Drop DataFlow Task from the SSIS Toolbox.
<div id="attachment_10784" style="width: 472px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/SSIS-drag-and-drop-data-flow.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10784" class="wp-image-10784 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/SSIS-drag-and-drop-data-flow.png" alt="Use data flow " width="462" height="157" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/SSIS-drag-and-drop-data-flow.png 462w, https://zappysys.com/blog/wp-content/uploads/2018/07/SSIS-drag-and-drop-data-flow-300x102.png 300w" sizes="(max-width: 462px) 100vw, 462px" /></a><p id="caption-attachment-10784" class="wp-caption-text">Drag and drop Data flow task</p></div></li>
<li>Now, Drag and Drop SSIS ZS XML Source Component from the SSIS Toolbox (if your API is JSON based then drag ZS JSON Source).
<div id="attachment_10785" style="width: 854px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/SSIS-drag-and-drop-XML-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10785" class="wp-image-10785 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/SSIS-drag-and-drop-XML-source.png" alt="Drag and Drop ZS SSIS XML Source Component" width="844" height="401" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/SSIS-drag-and-drop-XML-source.png 844w, https://zappysys.com/blog/wp-content/uploads/2018/07/SSIS-drag-and-drop-XML-source-300x143.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/SSIS-drag-and-drop-XML-source-768x365.png 768w" sizes="(max-width: 844px) 100vw, 844px" /></a><p id="caption-attachment-10785" class="wp-caption-text">Drag and Drop ZS SSIS XML Source Component</p></div></li>
<li>Let&#8217;s double-click on XML Source Component to configure it&#8217;s Properties. Enter Request URL.<br />
<pre class="crayon-plain-tag">https://zappysys.com/downloads/files/test/soap-getdata.aspx</pre>
<div id="attachment_10786" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-URL.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10786" class="wp-image-10786 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-URL.png" alt="Enter URL to XML source" width="828" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-URL.png 828w, https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-URL-300x266.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-URL-768x682.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10786" class="wp-caption-text">SSIS XML Source: Enter your SOAP Request URL</p></div></li>
<li>Check Use Credentials (Username/Password OR Token), Select HTTP Connection Manager from the drop-down list, we have created just before.
<div id="attachment_10787" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-credential.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10787" class="wp-image-10787 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-credential.png" alt="USe a credentials inside XML source" width="828" height="374" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-credential.png 828w, https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-credential-300x136.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-enter-credential-768x347.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10787" class="wp-caption-text">ZS SSIS XML Source Component: Check Use Credentials and Select Connection Manager</p></div></li>
<li>Select the Request Method and Enter SOAP Request Body something like this. Notice that we used <strong>[$token$]</strong> as a placeholder. This is automatically replaced at runtime by ZS-HTTP Connection Manager.<strong>Passing Token in Body</strong><br />
<pre class="crayon-plain-tag">&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com"&gt;
   &lt;soapenv:Body&gt;
      &lt;urn:sessionid&gt;[$token$]&lt;/urn:sessionid&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
<strong>Passing Token in Header<br />
</strong><br />
If your API expects token via HTTP Header (e.g. <strong>Authorization:</strong> <strong>xxxx-my-token-xxxxxxxx</strong> ) then make sure you configure Auth Scheme and Header name on HTTP Connection. By default it sends Token in Authorization header if you dont do anything.</p>
<div id="attachment_10788" style="width: 836px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-Header.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10788" class="size-full wp-image-10788" src="https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-Header.png" alt="Dynamic Token in the header" width="826" height="733" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-Header.png 826w, https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-Header-300x266.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-Header-768x682.png 768w" sizes="(max-width: 826px) 100vw, 826px" /></a><p id="caption-attachment-10788" class="wp-caption-text">ZS SSIS XML Source Component: Enter SOAP Request Body</p></div></li>
<li>Select Content-Type as per your Request, here we are selecting <pre class="crayon-plain-tag">text/XML;charset=UTF-8</pre>  and adding 1 HTTP Header: <pre class="crayon-plain-tag">SOAPAction: "https://zappysys.com/soap-getdata"</pre>
<div id="attachment_10789" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-body.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10789" class="size-full wp-image-10789" src="https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-body.png" alt="Select Content-Type Add HTTP Request Header" width="828" height="742" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-body.png 828w, https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-body-300x269.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/Passing-Token-in-body-768x688.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10789" class="wp-caption-text">ZS SSIS XML Source Component: Select Content-Type Add HTTP Request Header</p></div></li>
<li>select Filter Path: set as per your requirements. here for this example, we are setting:<br />
<pre class="crayon-plain-tag">$.soapenv:Envelope.soapenv:Body.urn:Row[*]</pre>
<div id="attachment_10790" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10790" class="size-full wp-image-10790" src="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result.png" alt="XML source filter with dynamic token" width="828" height="742" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result.png 828w, https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result-300x269.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result-768x688.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10790" class="wp-caption-text">ZS SSIS XML Source Component: Select Filter</p></div>
<p>&nbsp;</li>
<li>Check Include Parent Columns checkbox, for including parent Columns, and then click on Preview button to see the Preview data.
<div id="attachment_10791" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result-preview.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10791" class="size-full wp-image-10791" src="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result-preview.png" alt="Preview data XML source dynamic token" width="828" height="742" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result-preview.png 828w, https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result-preview-300x269.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/XML-source-dynamic-token-result-preview-768x688.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-10791" class="wp-caption-text">SSIS XML Source Component: See the Preview data</p></div></li>
<li>That&#8217;s it. Click on OK button to Save your Configuration.</li>
<li>Finally drag any destination (i.e. OLEDB Destination) from your SSIS toolbox. If you want to load this data into SQL, then Drag OLE DB Destination Component, and configure it.</li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this blog, we learned how to call any SOAP/REST API with Dynamic Token, retrieve Service response data with SSIS using <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/">XML Source <span style="color: #0000ee;"><u>Component</u></span></a> OR <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON Source Component</a>   in a very simple way. Furthermore, you can achieve many more functionalities with this tool. Check our blogs/articles on <strong>XML Source Component </strong>to find out what <em>this tool</em> is capable of more.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following links for more information about the call any SOAP / REST API with Dynamic Token feature with our tools:</p>
<ul>
<li><strong>Landing Page</strong> for <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/">XML Source</a>, you can also find <a href="https://youtu.be/2Li6Vy-nQvw">Tutorial Video</a> here.</li>
<li><strong>Help File:</strong> Documentation of <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-xml-source.htm">XML Source</a>.</li>
</ul>
<p>The post <a href="https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/">How to call SOAP / REST API using Dynamic Token in SSIS / ODBC</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Loading data from SQL Server to Elasticsearch with SSIS</title>
		<link>https://zappysys.com/blog/load-data-from-sql-server-to-elasticsearch-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 16 Jun 2017 17:08:12 +0000</pubDate>
				<category><![CDATA[HTTP Connection]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS Connection Manager]]></category>
		<category><![CDATA[SSIS JSON Generator Transform]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[API Integration]]></category>
		<category><![CDATA[elasticsearch]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis web api destination]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=1365</guid>

					<description><![CDATA[<p>Introduction Elasticsearch is a powerful engine that allows you to store, aggregate, and, most importantly, search data in a very analytical way. In this tutorial, you will learn how to bulk load data from SQL Server to Elasticsearch with SSIS (part of SQL Server) and ZappySys PowerPack. The scope of this article will be to show how to import [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/load-data-from-sql-server-to-elasticsearch-using-ssis/">Loading data from SQL Server to Elasticsearch with SSIS</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:#e5de9d;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:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>UPDATE:</strong> ZappySys has released a brand new <a href="https://zappysys.com/api/integration-hub/elasticsearch-connector/">API Connector for ElasticSearch</a> which makes it much simpler to <strong>Read/Write ElasticSearch Data in SSIS</strong> compared to the steps listed in this article. You can still use steps from this article but if you are new to API or want to avoid a learning curve with API then use a newer approach.</p>
<p>Please visit <a href="https://zappysys.com/api/integration-hub/">this page to see all</a> preconfigured ready-to-use API connectors that you can use in <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source</a> / <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-destination/">SSIS API Destination</a> OR <a href="https://zappysys.com/products/odbc-powerpack/odbc-api-driver/">API ODBC Driver</a> (for non-SSIS Apps such as Excel, Power BI, and Informatica).</p>
</div></div>
<img loading="lazy" decoding="async" class="alignleft wp-image-1406 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/06/elasticsearch-logo-180x180.png" alt="" width="180" height="180" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/elasticsearch-logo-180x180.png 180w, https://zappysys.com/blog/wp-content/uploads/2017/06/elasticsearch-logo-180x180-150x150.png 150w" sizes="(max-width: 180px) 100vw, 180px" /></p>
<p><a href="https://www.elastic.co/" target="_blank" rel="noopener">Elasticsearch</a> is a powerful engine that allows you to store, aggregate, and, most importantly, search data in a very analytical way. In this tutorial, you will learn how to bulk load data from <em>SQL Server to Elasticsearch </em>with <a href="https://docs.microsoft.com/en-us/sql/integration-services/sql-server-integration-services" target="_blank" rel="noopener"><acronym title="SQL Server Integration Services">SSIS</acronym></a> (part of SQL Server) and <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys PowerPack</a>.</p>
<p>The scope of this article will be to show how to import records from SQL Server into Elasticsearch index as JSON documents using <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html" target="_blank" rel="noopener">Elasticsearch Bulk API</a>. In a nutshell, we will retrieve IDs and names of the products from a SQL table, transform each row into a JSON and lastly, index each JSON in Elasticsearch under record&#8217;s corresponding ID. This tutorial is going to be your stepping stone to use any Elasticsearch API as a destination.</p>
<p>We will be using these SSIS components of PowerPack to make things work:</p>
<div class="su-table su-table-alternate">
<table width="276">
<tbody>
<tr style="line-height: 0px">
<td width="50px"><a href="//zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1382" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-json-generator-transform.png" alt="" width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="//zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">JSON Generator Transform</a></td>
</tr>
<tr style="line-height: 0px">
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1383" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-web-api-destination.png" alt="" width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="//zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a></td>
</tr>
</tbody>
</table>
</div>
<p>Let&#8217;s begin?</p>
<h2>Prerequisites</h2>
<ol>
<li>SSIS designer installed. Sometimes it is referred as BIDS or SSDT (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li><em>Northwind</em> database deployed on your machine (we will use it to load data from; <a href="//zappysys.com/blog/wp-content/uploads/2017/06/Northwind.zip" target="_blank" rel="noopener">download it</a>).</li>
<li><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html" target="_blank" rel="noopener"><i>Elasticsearch </i>instance up and running</a>.</li>
<li><a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener"><em>ZappySys SSIS PowerPack</em> installed</a>.</li>
</ol>
<p>&nbsp;</p>
<div class="su-note"  style="border-color:#e5de9d;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:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> If your ElasticSearch instance is hosted as <a href="https://aws.amazon.com/elasticsearch-service/" target="_blank" rel="noopener">AWS Managed ElasticSearch Instance</a> then select  <pre class="crayon-plain-tag">&lt;New ZS-OAUTH Connection&gt;</pre>. rather than ZS-HTTP (Explained later in this article). When OAuth UI launches select AWS v4 Provider. For more information on <a href="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/" target="_blank" rel="noopener">calling REST API on AWS check this article</a>. </div></div>
<h2>Step-by-Step – Bulk loading data from SQL Server to Elasticsearch with SSIS</h2>
<h3>Load data from SQL Server database first</h3>
<p>In this section, you will perform several basic steps to start the package: load data from SQL Server and prepare it for further steps.</p>
<ol>
<li>Create a new SSIS package and drag a <em>Data Flow Task</em> into the <em>Control Flow</em> from the SSIS Toolbox.
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Open <em>Data Flow Task</em> and then add <em>OLE DB Source.</em></li>
<li>Configure OLE DB Source to take data from <em>Products </em>table<em>, Northwind</em> database.</li>
<li>Choose <em>ProductID</em> and <em>ProductName</em> as columns you will use.
<div id="attachment_2394" style="width: 251px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-control-flow-3.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2394" class="wp-image-2394 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-control-flow-3.png" alt="Load data to Elasticsearch using SSIS and ZappySys Web API Destination component." width="241" height="306" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-control-flow-3.png 241w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-control-flow-3-236x300.png 236w" sizes="(max-width: 241px) 100vw, 241px" /></a><p id="caption-attachment-2394" class="wp-caption-text">Load data to Elasticsearch using SSIS and ZappySys Web API Destination component.</p></div></li>
</ol>
<h3>Transform data into JSON documents</h3>
<p>To add data into Elasticsearch firstly we need to prepare it with <em>JSON Generator Transform. </em>It will help us convert table rows into JSON documents.</p>
<h4>JSON String to Create Index data for the Bulk API call</h4>
<ol>
<li>Close the window and then drag <em>Derived Column </em>component from the SSIS Toolbox.</li>
<li>Furthermore, Add two new columns and name them <pre class="crayon-plain-tag">RowHeader</pre> and <pre class="crayon-plain-tag">RowFooter</pre>:
<div id="attachment_2406" style="width: 691px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2406" class="wp-image-2406 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2.png" alt="Derived Column configuration to add prefix and header and footer to a JSON" width="681" height="443" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2.png 681w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2-300x195.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></a><p id="caption-attachment-2406" class="wp-caption-text">Derived Column configuration to add prefix and header and footer to a JSON</p></div>
<p>In the <em>Expression</em> column give them values:</p>
<ul>
<li><strong>RowHeader</strong>:<br />
<pre class="crayon-plain-tag">"{ \"index\": { \"_index\": \"shop\", \"_type\": \"products\", \"_id\" : \"" + (DT_WSTR,100)ProductID + "\" } }\n"</pre>
</li>
<li><strong>RowFooter</strong>:  <pre class="crayon-plain-tag">"\n"</pre></li>
</ul>
</li>
<li>Now drag <em>JSON Generator Transform</em> from the SSIS Toolbox and open it.</li>
<li>Right mouse click on item <em>Mappings </em>and select <pre class="crayon-plain-tag">Add Element(s) (Below this node)</pre>:
<div id="attachment_1415" style="width: 330px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-json-generator-transform-add-mapping.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1415" class="wp-image-1415 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-json-generator-transform-add-mapping.png" alt="Convert SQL table rows into JSON using JSON Generator Transform" width="320" height="116" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-json-generator-transform-add-mapping.png 320w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-json-generator-transform-add-mapping-300x109.png 300w" sizes="(max-width: 320px) 100vw, 320px" /></a><p id="caption-attachment-1415" class="wp-caption-text">Convert SQL table rows into JSON using <em>JSON Generator Transform</em></p></div></li>
<li>Once a dialog appears, select <pre class="crayon-plain-tag">ProductName</pre> as <em>Source Column</em> and <pre class="crayon-plain-tag">name</pre> as <em>Output Alias:<br />
</em></p>
<div id="attachment_1526" style="width: 386px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-json-generator-transform-add-mapping-3.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1526" class="size-full wp-image-1526" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-json-generator-transform-add-mapping-3.jpg" alt="Map table column to JSON property using JSON Generator Transform" width="376" height="438" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-json-generator-transform-add-mapping-3.jpg 376w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-json-generator-transform-add-mapping-3-258x300.jpg 258w" sizes="(max-width: 376px) 100vw, 376px" /></a><p id="caption-attachment-1526" class="wp-caption-text">Map table column to JSON property using <em>JSON Generator Transform</em></p></div></li>
<li>You should get a similar view:
<div id="attachment_2396" style="width: 728px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-convert-rows-into-json-using-json-generator-transform-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2396" class="wp-image-2396 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-convert-rows-into-json-using-json-generator-transform-2.png" alt="JSON Generator Transform configuration to create JSON from a SQL table" width="718" height="320" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-convert-rows-into-json-using-json-generator-transform-2.png 718w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-convert-rows-into-json-using-json-generator-transform-2-300x134.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></a><p id="caption-attachment-2396" class="wp-caption-text"><em>JSON Generator Transform</em> configuration to create JSON from a SQL table</p></div></li>
<li>Then go to <em>Header / Footer</em> tab and:
<ul>
<li>Select <pre class="crayon-plain-tag">Direct String</pre> option.</li>
<li>Input <pre class="crayon-plain-tag">&lt;%RowHeader%&gt;</pre> in <em>Header String</em> option.</li>
<li>Input <pre class="crayon-plain-tag">&lt;%RowFooter%&gt;</pre> in <em>Footer String</em> option.</li>
</ul>
<div id="attachment_2403" style="width: 728px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-convert-rows-into-json-using-json-generator-transform-3-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2403" class="wp-image-2403 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-convert-rows-into-json-using-json-generator-transform-3-1-e1513951668585.png" alt="JSON Generator Transform configuration to convert rows into JSON suitable for Elasticsearch Bulk operation" width="718" height="400" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-convert-rows-into-json-using-json-generator-transform-3-1-e1513951668585.png 718w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-convert-rows-into-json-using-json-generator-transform-3-1-e1513951668585-300x167.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></a><p id="caption-attachment-2403" class="wp-caption-text"><em>JSON Generator Transform</em> configuration to convert rows into JSON suitable for Elasticsearch Bulk operation</p></div></li>
<li>Close the window.</li>
</ol>
<h4>JSON String to Update Index data for the Bulk API call</h4>
<p>From the above section &#8220;<strong>JSON String to Create Index data for the Bulk API call&#8221; </strong>follows all the steps From <strong>Step-1 to Step-8.</strong></p>
<p>Just for (2nd step) <strong>Step-2</strong> use below expression for  <pre class="crayon-plain-tag">RowHeader</pre> and <pre class="crayon-plain-tag">RowFooter</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2.png"><img loading="lazy" decoding="async" class="wp-image-2406 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2.png" alt="Derived Column configuration to add prefix and header and footer to a JSON" width="681" height="443" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2.png 681w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2-300x195.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></a></p>
<p>Derived Column configuration to add prefix and header and footer to a JSONIn the <em>Expression</em> column give them values:</p>
<ul>
<li><strong>RowHeader</strong>:<br />
<pre class="crayon-plain-tag">"{ \"update\": { \"_index\": \"shop\", \"_id\" : \"" + (DT_WSTR,100)ProductID + "\" } }\n{ \"doc\" : "</pre>
</li>
<li><strong>RowFooter</strong>:  <pre class="crayon-plain-tag">"}\n"</pre></li>
</ul>
<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>NOTE</strong>: To learn how to make more complicated transforms visit these links:</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/</a> (check the video)</li>
<li><a href="https://zappysys.com/blog/tag/ssis-json-generator-transform/" target="_blank" rel="noopener">https://zappysys.com/blog/tag/ssis-json-generator-transform/</a></li>
</ul>
</div></div>
<h4>JSON String to Delete Index data for the Bulk API call</h4>
<p>From the above section &#8220;<strong>JSON String to Create Index data for the Bulk API call&#8221; </strong>follows steps <strong>Step-1 and Step-2.</strong></p>
<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>NOTE</strong>: No need to use JSON Generator Transform (From Step-3). </div></div>
<p>Just for (2nd step) <strong>Step-2</strong> use below expression for  <pre class="crayon-plain-tag">RowHeader</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2.png"><img loading="lazy" decoding="async" class="wp-image-2406 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2.png" alt="Derived Column configuration to add prefix and header and footer to a JSON" width="681" height="443" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2.png 681w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-derived-columns-2-300x195.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></a></p>
<p>Derived Column configuration to add prefix and header and footer to a JSON</p>
<p>In the <em>Expression</em> column give them values:</p>
<ul>
<li><strong>RowHeader</strong>:<br />
<pre class="crayon-plain-tag">"{ \"delete\": { \"_index\": \"shop\", \"_id\" : \"" + (DT_WSTR,100)ProductID + "\" } }\n"</pre>
</li>
</ul>
<h3>Finally, Elasticsearch &amp; SQL Server integration</h3>
<ol>
<li>Now drag <em>Web API Destination</em> SSIS component into the Data Flow and open it for editing.</li>
<li>In <em>Select Connection</em> section press <pre class="crayon-plain-tag">&lt;New ZS-HTTP Connection&gt;</pre>.<br />
<strong>NOTE:</strong> If your ElasticSearch instance is hosted as AWS Managed Service then select  <pre class="crayon-plain-tag">&lt;New ZS-OAUTH Connection&gt;</pre>. rather than ZS-HTTP. When OAuth UI launches select AWS v4 Provider. For more information on <a href="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/" target="_blank" rel="noopener">calling REST API on AWS check this article</a>.</li>
<li>Once <em>HTTP Connection Manager</em> window opens configure connection to your Elasticsearch instance:
<ul>
<li>Set <em>Web Url</em>, which points to your Elasticsearch instance.</li>
<li>Set <em>Credentials Type</em> to <pre class="crayon-plain-tag">Basic - UserID/Password</pre> (or other appropriate authentication method).</li>
<li>Finally, set <em>User Name</em> and <em>Password:<br />
</em></p>
<div id="attachment_1419" style="width: 330px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-configure-http-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1419" class="wp-image-1419 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-configure-http-connection.png" alt="Configure SSIS HTTP Connection to connect to Elasticsearch" width="320" height="207" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-configure-http-connection.png 320w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-post-data-to-elasticsearch-configure-http-connection-300x194.png 300w" sizes="(max-width: 320px) 100vw, 320px" /></a><p id="caption-attachment-1419" class="wp-caption-text">Configure SSIS <em>HTTP Connection</em> to connect to Elasticsearch</p></div></li>
</ul>
</li>
<li>Close configuration window. Now it&#8217;s time to configure <em>Web API Destination</em>.</li>
<li>All that is separating you from getting those rows into Elasticsearch is:
<ul>
<li>Setting <em>Input Column</em> <em>for Body</em> to <pre class="crayon-plain-tag">ZS_JSON_OUT</pre> for <strong>Create and Update</strong> Index Data and for <strong>Delete</strong> Index Data <em>Input Column for Body</em> to <pre class="crayon-plain-tag">RowHeader [Derived Column]</pre>.</li>
<li>Setting <em>URL</em> to <pre class="crayon-plain-tag">http://localhost:9200/_bulk</pre>.</li>
<li>Setting <em>HTTP Request</em> Method to <pre class="crayon-plain-tag">POST</pre>.</li>
</ul>
<div id="attachment_2397" style="width: 711px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-web-api-destination-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2397" class="wp-image-2397 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-web-api-destination-2.png" alt="Index SQL Server Database data in Elasticsearch using SSIS component &quot;Web API Destination&quot;" width="701" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-web-api-destination-2.png 701w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-web-api-destination-2-300x267.png 300w" sizes="(max-width: 701px) 100vw, 701px" /></a><p id="caption-attachment-2397" class="wp-caption-text">Index SQL Server Database data in Elasticsearch using SSIS component <em>Web API Destination</em></p></div></li>
<li>Then open <em>Batch Settings (For Body)</em> tab:
<ul>
<li>Enable batch submission.</li>
<li>Set <em>Body Batch Size, </em>e.g. 1000<em>. </em>Make sure this number is even, otherwise you may get into problems (Elasticsearch Bulk request has special JSON request body format, as you perhaps noticed).</li>
</ul>
<div id="attachment_2415" style="width: 711px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-web-api-destination-3.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2415" class="wp-image-2415 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-web-api-destination-3.png" alt="Web API Destination batch settings configuration" width="701" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-web-api-destination-3.png 701w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-post-data-to-elasticsearch-web-api-destination-3-300x267.png 300w" sizes="(max-width: 701px) 100vw, 701px" /></a><p id="caption-attachment-2415" class="wp-caption-text"><em>Web API Destination</em> batch settings configuration</p></div></li>
<li>Close the window and run the package! You should see green lights, telling you everything is OK:
<div id="attachment_2398" style="width: 302px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-load-success-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2398" class="wp-image-2398 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-load-success-2.png" alt="Successful data load from SQL Server to Elasticsearch" width="292" height="391" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-load-success-2.png 292w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-load-success-2-224x300.png 224w" sizes="(max-width: 292px) 100vw, 292px" /></a><p id="caption-attachment-2398" class="wp-caption-text">Successful data load from SQL Server to Elasticsearch</p></div></li>
<li>We can also query Elasticsearch by using one of its <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html" target="_blank" rel="noopener">Search APIs</a> &#8211; <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-uri-request.html" target="_blank" rel="noopener">URI Search</a> to see if we successfully indexed data:
<div id="attachment_1470" style="width: 363px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-load-results.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1470" class="wp-image-1470" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-load-results.png" alt="SQL Server data index in Elasticsearch" width="353" height="450" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-load-results.png 429w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-load-results-235x300.png 235w" sizes="(max-width: 353px) 100vw, 353px" /></a><p id="caption-attachment-1470" class="wp-caption-text">SQL Server data index in Elasticsearch</p></div></li>
<li>Rows number match in SSIS and in search results, thus everything is good. You are done.</li>
</ol>
<h3>What if I want more? After upserting data use <em>Web API Destination</em> further</h3>
<p>Let&#8217;s say you have a requirement to do something with rows that were freshly indexed in Elasticsearch. Then you will need somehow to distinguish between created and updated records in Elasticsearch. And that won&#8217;t be difficult because <em>Web API Destination</em> acts not only as <span style="text-decoration: underline;">Destination</span> but as <span style="text-decoration: underline;">Transformation</span> as well. So one thing you have to do is connect <em><a href="//zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/" target="_blank" rel="noopener">JSON Parser Transform</a></em> downstream to <em>Web API Destination</em>. It will parse Elasticsearch HTTP JSON response – which is returned by <em>Web API Destination –</em> into columns, which you can later easily redirect using <em>Conditional Split:</em></p>
<ol>
<li>Add <em>JSON Parser Transform</em> and connect it to <em>Web API Destination</em>:
<div id="attachment_1476" style="width: 415px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1476" class="size-full wp-image-1476" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-http-response-parsing.png" alt="Add JSON Parser Transform to get Elasticsearch HTTP JSON response when integrating SQL Server &amp; Elasticsearch" width="405" height="394" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-http-response-parsing.png 405w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-http-response-parsing-300x292.png 300w" sizes="(max-width: 405px) 100vw, 405px" /><p id="caption-attachment-1476" class="wp-caption-text">Use <em>JSON Parser Transform</em> to get Elasticsearch HTTP JSON response when integrating SQL Server &amp; Elasticsearch</p></div></li>
<li>Make sure you have selected <pre class="crayon-plain-tag">ResponseText</pre> as <em>Select Input JSON Column.</em></li>
<li>Then go to <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html" target="_blank" rel="noopener">Bulk API</a> and copy/paste &#8220;the result of this bulk operation&#8221; JSON response:
<div id="attachment_2399" style="width: 714px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-json-parser-transform-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2399" class="wp-image-2399 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-json-parser-transform-configuration.png" alt="Using JSON Parser Transform to parse JSON response from REST HTTP request" width="704" height="622" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-json-parser-transform-configuration.png 704w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-json-parser-transform-configuration-300x265.png 300w" sizes="(max-width: 704px) 100vw, 704px" /></a><p id="caption-attachment-2399" class="wp-caption-text">Using <em>JSON Parser Transform</em> to parse JSON response from REST HTTP request</p></div></li>
<li>Set <pre class="crayon-plain-tag">$.items[*]</pre> as the filter.</li>
<li><strong>Optional step</strong>. You won&#8217;t find a response sample for every Elasticsearch API call. In that case, you may want to use <a href="http://www.getpostman.com" target="_blank" rel="noopener">Postman</a> to make an HTTP request to Elasticsearch and get a sample response:
<div id="attachment_1513" style="width: 589px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-using-postman-to-troubleshoot.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1513" class="wp-image-1513 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-using-postman-to-troubleshoot.png" alt="Use Postman to make a request to Elasticsearch and get a sample response to be used in JSON Parser Transform" width="579" height="587" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-using-postman-to-troubleshoot.png 579w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-using-postman-to-troubleshoot-296x300.png 296w" sizes="(max-width: 579px) 100vw, 579px" /></a><p id="caption-attachment-1513" class="wp-caption-text">Use <em>Postman</em> to make a request to Elasticsearch and get a sample response to be used in <em>JSON Parser Transform</em></p></div>
<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>NOTE</strong>: Don&#8217;t forget to set the username and password in <em>Authorization</em> section!</div></div></li>
<li>Then use a <em>Conditional Split </em>and <a href="//zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> to redirect the rows:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-conditional-split.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2410" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-conditional-split.png" alt="" width="893" height="394" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-conditional-split.png 893w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-conditional-split-300x132.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-sql-server-to-elasticsearch-conditional-split-768x339.png 768w" sizes="(max-width: 893px) 100vw, 893px" /></a><br />
Input these clauses:</p>
<ul>
<li><strong>Inserted</strong>:<br />
<pre class="crayon-plain-tag">REPLACENULL([index.result],"") == "created" || REPLACENULL([create.result],"") == "created"</pre>
</li>
<li><strong>Updated</strong>:<br />
<pre class="crayon-plain-tag">REPLACENULL([index.result],"") == "updated" || REPLACENULL([create.result],"") == "updated"</pre>
</li>
</ul>
</li>
<li>As a result, new index records will be redirected to one destination, while updated records &#8211; to the other:<br />
<a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-integration-results.png"><img loading="lazy" decoding="async" width="423" height="388" class="wp-image-1478 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-integration-results.png" alt="&quot;Result" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-integration-results.png 423w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-integration-results-300x275.png 300w" sizes="(max-width: 423px) 100vw, 423px" /></a></li>
</ol>
<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>NOTE</strong>: <em>Trash Destination</em> is a handy component of <em>ZappySys PowerPack</em> which can be used as dummy destination when we don&#8217;t care about the destination (and we don&#8217;t care in this tutorial) 🙂</div></div>
<p>Overall you can use <em>Web API Destination</em> HTTP JSON response for other useful things as well, e.g. determine on how many <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/_basic_concepts.html#getting-started-shards-and-replicas" target="_blank" rel="noopener">replica shards</a> record was indexed. JSON response will depend on which Elasticsearch API and which method you use.</p>
<h3>Delete Index by making an API call.</h3>
<p>If you want to delete the index by making <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html" target="_blank" rel="noopener">Delete API</a> call you can. Let&#8217;s make that call using the Rest API Task. Configure it like below screen and click on the Test Request button.</p>
<div id="attachment_8605" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-rest-api-task-delete-method.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8605" class="wp-image-8605 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-rest-api-task-delete-method-768x523.png" alt="Rest API Delete Method" width="720" height="490" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-rest-api-task-delete-method-768x523.png 768w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-rest-api-task-delete-method-300x204.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-rest-api-task-delete-method.png 901w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-8605" class="wp-caption-text">Rest API Delete Method</p></div>
<h3>Things went bad: Error handling &amp; debugging</h3>
<p>Incidentally, you may incorrectly construct JSON for <em>Web API Destination</em> body<i>. </i>Elasticsearch nodes may go offline or go out of memory. In any case you may want to know when that happens and take actions accordingly. For that purpose you have to redirect failed requests from <em>Web API Destination</em> to some other destination:</p>
<ol>
<li>Add a <em>Derived Column</em> above <em>Web API Destination</em> with expression <pre class="crayon-plain-tag">(DT_WSTR,4000)ZS_JSON_OUT</pre> and name it <pre class="crayon-plain-tag">JsonAsString</pre>. This will let you see what JSON you are actually passing.</li>
<li>After that, add database or file destination or use another <em>Trash Destination</em> for debugging purposes and redirect the bad rows (<span style="color: #d66565;">red arrow</span>) from <em>Web API Destination </em>into it<em>. </em>Don&#8217;t forget to set <pre class="crayon-plain-tag">Redirect row</pre> option for both, <em>Error</em> and <em>Truncation</em> columns:<em><br />
</em><a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png"><img loading="lazy" decoding="async" width="739" height="267" class="wp-image-1487 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png" alt="&quot;Redirect" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png 739w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows-300x108.png 300w" sizes="(max-width: 739px) 100vw, 739px" /></a></li>
<li>Finally, add a <a href="https://technet.microsoft.com/en-us/library/ms140318%28v=sql.90%29.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener"><em>Data Viewer</em></a> for the red path, if you want to debug the flow. You will be able to see URL, JSON and the error message for each record. You may want to copy-paste <em>ErrorMessage</em> to <em>Notepad </em>if you want it to be more readable:
<div id="attachment_1494" style="width: 762px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1494" class="wp-image-1494 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png" alt="Use Data Viewer to view HTTP requests that failed to be fulfilled in Elasticsearch" width="752" height="280" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png 752w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-300x112.png 300w" sizes="(max-width: 752px) 100vw, 752px" /></a><p id="caption-attachment-1494" class="wp-caption-text">Use<em> Data Viewer</em> to view HTTP requests that failed to be fulfilled in Elasticsearch</p></div></li>
</ol>
<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>NOTE</strong>: You can read more about redirecting rows in <a href="//zappysys.com/blog/ssis-error-handling-in-data-flow-redirect-bad-rows/" target="_blank" rel="noopener">SSIS Error Handling (Redirect bad rows)</a> article.</div></div>
<h2>Call ElasticSearch API hosted on AWS</h2>
<p>If your ElasticSearch instance is hosted as <a href="https://aws.amazon.com/elasticsearch-service/" target="_blank" rel="noopener">AWS Managed ElasticSearch Instance</a> then select  <pre class="crayon-plain-tag">&lt;New ZS-OAUTH Connection&gt;</pre>. rather than ZS-HTTP (Explained later in this article). When OAuth UI launches select AWS v4 Provider. For more information on <a href="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/" target="_blank" rel="noopener">calling REST API on AWS check this article</a>.</p>
<div id="attachment_6277" style="width: 836px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6277" class="size-full wp-image-6277" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4.png" alt="Call AWS Hosted ElasticSearch REST API in SSIS (V4 Request Signing)" width="826" height="730" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4.png 826w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4-300x265.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4-768x679.png 768w" sizes="(max-width: 826px) 100vw, 826px" /></a><p id="caption-attachment-6277" class="wp-caption-text">Call AWS Hosted ElasticSearch REST API in SSIS (V4 Request Signing)</p></div>
<h2>Common Errors</h2>
<div class="content_block" id="custom_post_widget-1887"><h3>Truncation related error</h3>
<p style="text-align: justify;">The most common error you may face when you run an SSIS package is truncation error. During the design time only 300 rows are scanned from a source (a file or a REST API call response) to detect datatypes but at runtime, it is likely you will retrieve far more records. So it is possible that you will get longer strings than initially expected. For detailed instructions on how to fix common metadata related errors read an article "<a href="//zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">How to handle SSIS errors (truncation, metadata issues)</a>".</p>

<h3>Authentication related error</h3>
Another frequent error you may get is an authentication error, which happens when you deploy/copy a package to another machine and run it there. Check <a href="#Deployment_to_Production">the paragraph below</a> to see why it happens and how to solve this problem.</div>
<h2>Deployment to Production</h2>
<div class="content_block" id="custom_post_widget-1932"><p style="text-align: justify;">In SSIS package <a href="https://docs.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages" target="_blank" rel="noopener">sensitive data such as tokens and passwords are by default encrypted by SSIS</a> with your Windows account which you use to create a package. So SSIS will fail to decrypt tokens/passwords when you run it from another machine using another Windows account. To circumvent this when you are creating an SSIS package which uses authentication components (e.g. an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> or an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a> with credentials, etc.), consider using parameters/variables to pass tokens/passwords. In this way, you won’t face authentication related errors when a package is deployed to a production server.</p>
<p style="text-align: justify;">Check our article on <a href="https://zappysys.com/blog/how-to-run-an-ssis-package-with-sensitive-data-on-sql-server/" target="_blank" rel="noopener">how to configure packages with sensitive data on your production or development server</a>.</p></div>
<h2>Download a sample package</h2>
<p>Be sure to download a <a href="https://zappysys.com/blog/wp-content/uploads/2017/06/Bulk-load-data-from-SQL-Server-to-Elasticsearch-using-SSIS.zip">sample SQL Server 2008 SSIS package</a>, in case you want to try it right away (you can upgrade it to a higher version).<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;"><strong>NOTE</strong>: Once you open the package, you won’t be able to run it immediately, but don’t panic. Just configure OLE DB Source to point to your Northwind database and set URLs to point to your Elasticsearch instance.</div></div>
<h2>Conclusion. What&#8217;s next?</h2>
<p>In conclusion, in this article we have learned how to bulk load data from SQL Server and upsert it in Elasticsearch index. We used <a href="//zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">JSON Generator Transform</a> to help us convert database table rows into JSON documents. In addition, <a href="//zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a> was very helpful in automatically creating and making HTTP requests to Elasticsearch instance and indexing our data as a result. This tutorial was quite simple and straightforward, yet it is a good starter to use other Elasticsearch APIs and their features. From now on <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" target="_blank" rel="noopener">Elasticsearch reference</a> is your best friend in learning what APIs exist, what are their methods and how HTTP requests should look like.</p>
<p><strong>Keywords</strong></p>
<p>How to import data from SQL Server to Elasticsearch | How to load data into Elasticsearch | Using Elasticsearch to index SQL Server | Elasticsearch and SQL Server integration | How to use Elasticsearch together with SQL Server | Upsert SQL Server data into Elasticsearch</p>
<p>The post <a href="https://zappysys.com/blog/load-data-from-sql-server-to-elasticsearch-using-ssis/">Loading data from SQL Server to Elasticsearch with SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
