<?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>SSIS XML Generator Transform Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/ssis/components/ssis-xml-generator-transform/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/ssis/components/ssis-xml-generator-transform/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 20 Feb 2020 16:00:06 +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>SSIS XML Generator Transform Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/ssis/components/ssis-xml-generator-transform/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to batch REST API requests in SSIS (Bulk Operation)</title>
		<link>https://zappysys.com/blog/batch-rest-api-requests-ssis-bulk-operation/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 06 Feb 2019 21:32:43 +0000</pubDate>
				<category><![CDATA[SSIS CSV Generator Transform]]></category>
		<category><![CDATA[SSIS JSON Generator Transform]]></category>
		<category><![CDATA[SSIS Script Component]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[SSIS XML Generator Transform]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6305</guid>

					<description><![CDATA[<p>Introduction In our previous article we saw how to POST data to REST API using few different ways. Now let&#8217;s go one step further and discuss another common scenario to batch REST API requests in SSIS. For efficient data transfer many API provides you to submit multiple records in a single request. In this article [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/batch-rest-api-requests-ssis-bulk-operation/">How to batch REST API requests in SSIS (Bulk Operation)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our previous article we saw <a href="https://zappysys.com/blog/http-post-in-ssis-send-data-to-web-api-url-json-xml/" target="_blank" rel="noopener">how to POST data to REST API</a> using few different ways. Now let&#8217;s go one step further and discuss another common scenario to batch REST API requests in SSIS. For efficient data transfer many API provides you to submit multiple records in a single request. In this article we will look at few ways to batch our requests using <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">SSIS JSON Generator Transform</a> and  <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">SSIS Web API destination</a>.</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>Method 1 &#8211; Batch records using SSIS JSON / XML Generator Transform</h2>
<p>First let&#8217;s look at common way to group multiple records and generate single JSON or XML document for desired batch size. We will also see another technique where you can assign Unique BatchID to each document.</p>
<p>For example below screenshot shows how to product one JSON document for every 10 input rows. We have also use BatchID column on the root level. This will use use BatchID from first row of that batch. You can use <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">XML Generator Transform</a> if you like to produce XML Document rather than JSON.</p>
<p>To generate Unique BatchID you can use function like newid() in SQL Server.</p><pre class="crayon-plain-tag">SELECT newid() as BatchID,CustomerID,CompanyName FROM Customers</pre><p>
<div id="attachment_6306" style="width: 1115px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-6306" class="size-full wp-image-6306" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting.png" alt="Using SSIS JSON Generator Transform with Batch Option (Multiple Records in a single document)" width="1105" height="865" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting.png 1105w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting-300x235.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting-768x601.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting-1024x802.png 1024w" sizes="(max-width: 1105px) 100vw, 1105px" /></a><p id="caption-attachment-6306" class="wp-caption-text">Using SSIS JSON Generator Transform with Batch Option (Multiple Records in a single document)</p></div>
<p>&nbsp;</p>
<p>Here if full flow to batch your JSON Requests and Submit to REST API.</p>
<div id="attachment_6307" style="width: 671px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-post-data-rest-api-in-batch.png"><img decoding="async" aria-describedby="caption-attachment-6307" class="size-full wp-image-6307" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-post-data-rest-api-in-batch.png" alt="POST data to REST API in Bulk Mode (Batch multiple rows)" width="661" height="785" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-post-data-rest-api-in-batch.png 661w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-post-data-rest-api-in-batch-253x300.png 253w" sizes="(max-width: 661px) 100vw, 661px" /></a><p id="caption-attachment-6307" class="wp-caption-text">POST data to REST API in Bulk Mode (Batch multiple rows)</p></div>
<p>&nbsp;</p>
<h2>Method 2 &#8211; Using SSIS Web API destination Batch Mode with Header / Footer</h2>
<p>Another method of batching is use Web API destination and turn on Batch mode.  You can <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">use Fiddler</a> to debug your web requests incase you are not sure how its generating and sending POST requests after this setting.</p>
<div id="attachment_2616" style="width: 919px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination.png"><img decoding="async" aria-describedby="caption-attachment-2616" class="size-full wp-image-2616" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination.png" alt="Configure SSIS Web API Destination for Bulk API call (Smartsheet REST API - Insert multiple rows)" width="909" height="445" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination.png 909w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination-300x147.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-call-smartsheet-rest-api-post-bulk-mode-web-api-destination-768x376.png 768w" sizes="(max-width: 909px) 100vw, 909px" /></a><p id="caption-attachment-2616" class="wp-caption-text">Configure SSIS Web API Destination for Bulk API call (Insert multiple rows)</p></div>
<h2>Method 3 &#8211; Batch CSV records using CSV Generator Transform</h2>
<p>So far we looked at how to batch JSON and XML format. Now let&#8217;s look at scenario where you have to POST CSV formatted data to REST API endpoint.</p>
<p>Assume that you have an API endpoint where you can submit data in multiple batches. Also you have few additional requirements</p>
<ol>
<li>First row of First batch must have column names (any other batch must not contains CSV Header)</li>
<li>In each Batch we want to submit maximum 5 rows as per API call</li>
<li>Each batch must contain Unique Batch Number in URL</li>
</ol>
<p>Here is high level flow.</p>
<div id="attachment_6333" style="width: 1148px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6333" class="size-full wp-image-6333" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting.png" alt="Generate CSV using Batch Setting , Send data to REST API in multiple batches, Debug REST API in Fiddler" width="1138" height="508" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting.png 1138w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting-300x134.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting-768x343.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-csv-using-output-in-batch-setting-1024x457.png 1024w" sizes="(max-width: 1138px) 100vw, 1138px" /></a><p id="caption-attachment-6333" class="wp-caption-text">Generate CSV using Batch Setting , Send data to REST API in multiple batches, Debug REST API in Fiddler</p></div>
<h3>Include CSV Header in First Batch Only</h3>
<p>Now let&#8217;s break down the problem and find out how to do. First problem is we need to include CSV Header only in First batch. To achieve this we use old school trick where we output column names as data row&#8230; and when we generate CSV in the next section we will turn off Column Headers option.</p>
<p>If you are consuming records from SQL Server or any other RDBMS you can write following style source query. If you don&#8217;t use relational source then use native UNION Transform in SSIS.</p><pre class="crayon-plain-tag">select 'CustomerID' as Column1, 'OrderID' as Column2
UNION ALL
select top 12 cast(CustomerID as varchar(1000)), cast(OrderID as varchar(1000)) from Invoices</pre><p>
<h3>Batch records and output CSV data</h3>
<p>Now next step would be to generate CSV data but in batches&#8230; so in our example we have to output size of 5 rows per batch. For this perform the following steps</p>
<ol>
<li>Drag ZS CSV Generator Transform (Included in <strong>v2.8</strong> and Higher)</li>
<li>Connect source to CSV Generator Transform</li>
<li>Now before we edit in UI mode, <strong>right click</strong> and select <strong>Properties</strong>. Change following 3 properties  (You can also change QuoteAroundValue and Dimiliter if needed). In future version batch setting will be visible in UI mode too.
<ol>
<li>ArrayBatchSize  = yourbatchsize (in our case it was just 5 rows per batch)</li>
<li>OutputMode = SingleFileFormat</li>
<li>FirstRowsHasColumnNames  =False</li>
</ol>
</li>
<li>Now double click to configure ZS Generator Output</li>
<li>Right click on Mappings folder node and Add Elements &gt; Select Multiple Columns  &gt; Check columns you like to output</li>
<li>Click OK to Save UI</li>
</ol>
<div id="attachment_6336" style="width: 611px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6336" class="size-full wp-image-6336" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch.png" alt="Generate CSV data in SSIS (Batch Output Setting)" width="601" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch.png 601w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-csv-generator-output-data-in-batch-300x300.png 300w" sizes="(max-width: 601px) 100vw, 601px" /></a><p id="caption-attachment-6336" class="wp-caption-text">Generate CSV data in SSIS (Batch Output Setting)</p></div>
<h3>Generate unique URL with Batch using Script Component</h3>
<p>Now next task we have to achieve is generate Unique Batch Number. Put that Batch ID in URL like below&#8230;</p><pre class="crayon-plain-tag">http://httpbin.org/post?batch=0
http://httpbin.org/post?batch=1
http://httpbin.org/post?batch=2
.....</pre><p>
<ol>
<li>For this drag SSIS Script Component and select Transformation Mode</li>
<li>Now go to <strong>Inputs and Outputs</strong> tab &gt; Select <strong>Output Columns</strong> &gt; Click <strong>Add Column</strong> &gt; Name it as <strong>URL</strong> &gt; Configure <strong>DataType</strong> as <strong>DT_WSTR</strong> , <strong>Length</strong> = 500</li>
<li>Now got Script Tab and Click Edit. Remove old code and enter following code (Assuming You selected C#). This code will generate new URL with Unique batch ID each time. You can use this same technique to generate Unique row number too (in that case rather than DT_WSTR type you can use DT_I4 type)</p><pre class="crayon-plain-tag">[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
    private static int _batch;
    public override void Input0_ProcessInputRow(Input0Buffer Row)
    {
        Row.Url = string.Format("http://httpbin.org/post?batch={0}",_batch);
        //If you have to send GUID rather than Integer for Batch ID then use below code
        //Row.Url = string.Format("http://httpbin.org/post?batch={0}",System.Guid.NewGuid());

        _batch = _batch+1;
    }
}</pre><p>
</li>
<li>Click OK to Save script.</li>
</ol>
<div id="attachment_6334" style="width: 681px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-script-component-unique-row-number-output-new-column.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6334" class="size-full wp-image-6334" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-script-component-unique-row-number-output-new-column.png" alt="Output Unique URL or Number using SSIS Script Transform" width="671" height="768" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-script-component-unique-row-number-output-new-column.png 671w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-script-component-unique-row-number-output-new-column-262x300.png 262w" sizes="(max-width: 671px) 100vw, 671px" /></a><p id="caption-attachment-6334" class="wp-caption-text">Output Unique URL or Number using SSIS Script Transform</p></div>
<h3>Configure Web API Destination to POST CSV Data</h3>
<p>Now final step is to configure SSIS Web API Destination to POST CSV data to API.</p>
<ol>
<li>Drag ZS Web API Destination and connect Source Transform to Web API destination.</li>
<li>Double click to configure</li>
<li>Select Connection Manager</li>
<li>Once connection setup, select Input Column for URL ( This will be same column from Script Transform)</li>
<li>Select column for Body (e.g. ZS_CSV_OUT)</li>
<li>Click OK to save</li>
</ol>
<div id="attachment_6335" style="width: 739px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-configure-web-api-destination-post-csv-data-in-batch.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6335" class="size-full wp-image-6335" src="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-configure-web-api-destination-post-csv-data-in-batch.png" alt="POST data to REST API in multiple batches using SSIS Web API destination" width="729" height="764" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-configure-web-api-destination-post-csv-data-in-batch.png 729w, https://zappysys.com/blog/wp-content/uploads/2019/02/ssis-configure-web-api-destination-post-csv-data-in-batch-286x300.png 286w" sizes="(max-width: 729px) 100vw, 729px" /></a><p id="caption-attachment-6335" class="wp-caption-text">POST data to REST API in multiple batches using SSIS Web API destination</p></div>
<h2>Debug Web API Requests using Fiddler</h2>
<p>Now we ready to run entire flow. Once you execute data flow, observe Input rows before CSV Generator Transform and after. CSV Generator transform must produce less rows before we now grouping multiple rows in a single batch.</p>
<p>Another important aspect to play with API request is to debug it, We recommend you to to look at <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">this article about using Fiddler to debug web requests</a>.</p>
<h2>Download Sample Package</h2>
<p>Here is the <a href="https://zappysys.com/blog/wp-content/uploads/2019/02/RestAPI_Batch.zip">Sample SSIS Package (2012 format) &#8211; Rest API_Batching</a></p>
<h2>Conclusion</h2>
<p>In this post, we saw how easy it is to handle complex REST API  / CSV /JSON / XML operations in SSIS. We configured REST API POST Operation using Batching Method. Hope this post helps you to achieve your API integration without coding.  Feel free to <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">download SSIS PowerPack</a> and try many other components not discussed in this article.</p>
<p>The post <a href="https://zappysys.com/blog/batch-rest-api-requests-ssis-bulk-operation/">How to batch REST API requests in SSIS (Bulk Operation)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Load SQL Server data to Workday using SSIS / SOAP API</title>
		<link>https://zappysys.com/blog/load-sql-server-data-workday-using-ssis-soap-api/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 29 Jan 2018 23:47:59 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[SSIS XML Generator Transform]]></category>
		<category><![CDATA[SSIS XML Parser Transform]]></category>
		<category><![CDATA[SSIS XML Source (File / SOAP)]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[SoapUI]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[workday]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2549</guid>

					<description><![CDATA[<p>Introduction In our previous article, we saw step-by-step approach to read data from workday using SSIS. In this article, we will focus on how to load SQL Server data to Workday (e.g. POST, Create, Update). We will use SSIS Web API Destination and the combination of other Transforms such as SSIS Template Transform and SSIS XML Generator [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/load-sql-server-data-workday-using-ssis-soap-api/">Load SQL Server data to Workday using SSIS / SOAP API</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span id="Introduction">Introduction</span></h2>
<p><a href="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration.png?ssl=1"><img loading="lazy" decoding="async" class="alignleft wp-image-1665" src="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration.png?resize=125%2C125&amp;ssl=1" sizes="(max-width: 125px) 100vw, 125px" srcset="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration.png?w=195&amp;ssl=1 195w, https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration.png?resize=150%2C150&amp;ssl=1 150w" alt="" width="125" height="125" data-attachment-id="1665" data-permalink="https://zappysys.com/blog/get-data-from-workday-in-ssis-using-soap-or-rest-api/workday-api-integration/#main" data-orig-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration.png?fit=195%2C195&amp;ssl=1" data-orig-size="195,195" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="workday-api-integration" data-image-description="" data-medium-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration.png?fit=195%2C195&amp;ssl=1" data-large-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/workday-api-integration.png?fit=195%2C195&amp;ssl=1" /></a>In our previous article, we saw step-by-step approach to <a href="https://zappysys.com/blog/get-data-from-workday-in-ssis-using-soap-or-rest-api/" target="_blank" rel="noopener">read data from workday using SSIS</a>. In this article, we will focus on how to load SQL Server data to Workday (e.g. POST, Create, Update). We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">SSIS Web API Destination</a> and the combination of other Transforms such as SSIS Template Transform and <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">SSIS XML Generator Transform</a> .</p>
<p>The main thing in this article how to create SOAP Request correctly inside your request. This article explains how to use Free tools like <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">SoapUI to create Workday Request</a>. Once you do that you can call virtually any Workday API using the same technique. If you need more help contact our <a href="https://zappysys.com/support/" target="_blank" rel="noopener">Support</a> and we will be happy to help you step by step.</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;"><b>Note:</b> Template Transform mentioned in this article is only available in <strong>v2.6.4 or Higher</strong></div></div>
<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>Step-By-Step : Import SQL Server data to Workday using SSIS</h2>
<p>Lets build our SSIS Package to load data from SQL Server or any Source (e.g. Oracle, DB2) to Workday using SOAP API calls. Using below approach you can Create new records or Update existing records in Workday. You can also delete records with same concept.</p>
<p>Basic steps outlined below.</p>
<ol>
<li>Fetch records from SQL Source and build XML Request for each Row (e.g. Create Account)</li>
<li>Build XML Request (SOAP Body) using Template Transform or  <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">SSIS XML Generator Transform</a>. If you have Array nodes (e.g. One to Many) then you have to use <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">SSIS XML Generator Transform</a> else use Template Transform for ease of use.</li>
<li>Pass input record (e.g. SOAP Body) to Web API destination to call Workday API call (CREATE, UPDATE, DELETE requests)</li>
<li>Parse XML Response (i.e. output) using <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-parser-transform/" target="_blank" rel="noopener">SSIS XML Parser Transform</a> or save raw XML to SQL Server database.</li>
<li>Redirect Bad rows or failed requests to log file for review</li>
</ol>
<p>Now let&#8217;s look at each step in detail</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 you are trying to get data from Workday <em><span style="text-decoration: underline;">report</span> </em>instead (your Workday admin created a report and gave you a link) then skip Soap UI part, use the URL with GET method and <em>Basic authentication</em> instead of SOAP WSS.</div></div>
<h3><span id="Obtain_Workday_API_URL">Obtain Workday API URL</span></h3>
<p>Once you have WSDL file, next step is craft correct URL for API service you like to call. The service name can be obtained from <a href="https://community.workday.com/sites/default/files/file-hosting/productionapi/index.html" target="_blank" rel="noopener">here</a> (Check service column)</p>
<p><strong>Syntax:</strong> <span id="crayon-5a6f9fdb25466286543213" class="crayon-syntax crayon-syntax-inline crayon-theme-vs2012 crayon-theme-vs2012-inline crayon-font-courier-new"><span class="crayon-pre crayon-code">https://&lt;workday host name&gt;.workday.com/ccx/service/&lt;tenant name&gt;/&lt;service-name&gt;</span></span><strong><br />
Example:</strong> <span id="crayon-5a6f9fdb25476699875511" class="crayon-syntax crayon-syntax-inline crayon-theme-vs2012 crayon-theme-vs2012-inline crayon-font-courier-new"><span class="crayon-pre crayon-code">https://MY-INSTANCE.workday.com/ccx/service/MY-TenantID/Human_Resources</span></span></p>
<h3><span id="Craft_SOAP_Body_XML_API_Request_using_SoapUI">Craft SOAP Body (XML API Request) using SoapUI</span></h3>
<p>Now its time to craft some SOAP Request. Check steps <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/">outlined here (Use SoapUI tool)</a> . Once you have Request Body XML you can change parameters as per your need.</p>
<p>Here is sample  SOAP XML Body for Get Employee call from Human_Resopurces service.</p>
<div id="crayon-5a6f9fdb2547e729542745" class="crayon-syntax crayon-theme-vs2012 crayon-font-courier-new crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover">
<div class="crayon-plain-wrap"><a href="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?ssl=1"><img loading="lazy" decoding="async" class="size-full wp-image-2543" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?resize=720%2C442&amp;ssl=1" sizes="(max-width: 720px) 100vw, 720px" srcset="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?w=735&amp;ssl=1 735w, https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?resize=300%2C184&amp;ssl=1 300w" alt="Create SOAP Request Body from WSDL (Using SoapUI tool)" width="702" height="431" data-attachment-id="2543" data-permalink="https://zappysys.com/blog/get-data-from-workday-in-ssis-using-soap-or-rest-api/create-workday-soap-request-using-soapui-api-xml-body/#main" data-orig-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?fit=735%2C451&amp;ssl=1" data-orig-size="735,451" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="create-workday-soap-request-using-soapui-api-xml-body" data-image-description="&lt;p&gt;Create SOAP Request Body from WSDL (Using SoapUI tool)&lt;/p&gt; " data-medium-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?fit=300%2C184&amp;ssl=1" data-large-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/01/create-workday-soap-request-using-soapui-api-xml-body.png?fit=720%2C442&amp;ssl=1" /></a></div>
</div>
<div id="attachment_2543" class="wp-caption alignnone">
<p class="wp-caption-text">Create SOAP Request Body from WSDL (Using SoapUI tool)</p>
</div>
<h3><span id="Creating_SSIS_Connection_for_Workday_SOAP_API_call_using_WSS_Security">Creating SSIS Connection for Workday SOAP API call using WSS Security</span></h3>
<div id="custom_post_widget-2536" class="content_block">
<p>To create a new connection for workday perform the following steps.</p>
<ol>
<li>Two ways you can create HTTP connection for the workday service<br />
<strong>First approach:</strong> Right click in the connection managers panel and click “New Connection…” and Select <strong>ZS-HTTP</strong>connection from the connection type list and click OK.<br />
<strong>— OR —</strong><br />
<strong>Second approach:</strong> If you are already on <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">SSIS XML Source</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">SSIS REST API TASK</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">SSIS Web API Destination</a> UI then click [New] next to the Connection Dropdown.</li>
<li>Once HTTP Connection UI is visible configure following way.
<ol>
<li>Enter API URL for Workday (Make sure you don’t enter WSDL URL <a href="https://community.workday.com/sites/default/files/file-hosting/productionapi/index.html" target="_blank" rel="noopener">found here</a> ). Your API URL will be something like below.<br />
<strong>Syntax:</strong> <pre class="crayon-plain-tag">https://&lt;workday host name&gt;.workday.com/ccx/service/&lt;tenant name&gt;/&lt;service-name&gt;</pre><strong><br />
Example:</strong> <pre class="crayon-plain-tag">https://wd1-impl-services1.workday.com/ccx/service/MyTenantID/Human_Resources</pre></li>
<li>Select credential type as SOAP WSS (This setting is only found in <strong>v2.6.4</strong> or Higher)</li>
<li>Enter your workday userid and password</li>
<li>For WSS password type setting you leave it default (Not set) or change to PasswordHash for more secure communication.</li>
<li>Click OK to save.</li>
</ol>
</li>
</ol>
<div id="attachment_2537" class="wp-caption alignnone">
<p><a href="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/01/ssis-soap-webservice-connection-workday-api-wss-security.png?ssl=1"><img loading="lazy" decoding="async" class="size-full wp-image-2537" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/01/ssis-soap-webservice-connection-workday-api-wss-security.png?resize=720%2C584&amp;ssl=1" sizes="(max-width: 720px) 100vw, 720px" srcset="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/01/ssis-soap-webservice-connection-workday-api-wss-security.png?w=783&amp;ssl=1 783w, https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/01/ssis-soap-webservice-connection-workday-api-wss-security.png?resize=300%2C243&amp;ssl=1 300w, https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/01/ssis-soap-webservice-connection-workday-api-wss-security.png?resize=768%2C623&amp;ssl=1 768w" alt="SSIS Workday Integration - Create New SAOP Service Connection for Workday API Service (SOAP WSS)" width="702" height="569" data-attachment-id="2537" data-permalink="https://zappysys.com/blog/content_block/workday-ssis-connection-setup/ssis-soap-webservice-connection-workday-api-wss-security/#main" data-orig-file="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/01/ssis-soap-webservice-connection-workday-api-wss-security.png?fit=783%2C635&amp;ssl=1" data-orig-size="783,635" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-soap-webservice-connection-workday-api-wss-security" data-image-description="&lt;p&gt;SSIS Workday Integration – Create New SAOP Service Connection for Workday API Service (SOAP WSS)&lt;/p&gt; " data-medium-file="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/01/ssis-soap-webservice-connection-workday-api-wss-security.png?fit=300%2C243&amp;ssl=1" data-large-file="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/01/ssis-soap-webservice-connection-workday-api-wss-security.png?fit=720%2C584&amp;ssl=1" /></a></p>
<p class="wp-caption-text">SSIS Workday Integration – Create New SAOP Service Connection for Workday API Service (SOAP WSS)</p>
</div>
<p>&nbsp;</p>
</div>
<h3><span id="Creating_SSIS_Connection_for_Workday_SOAP_API_call_using_WSS_Security">Loading SQL Server data to Workday using SSIS</span></h3>
<p>Let&#8217;s look at the real-world scenario. You have Accounts table stored in SQL Server and you like to create same accounts in Workday by calling appropriate API calls.</p>
<ol>
<li>Drag Data flow task from SSIS Toolbox. Double click to edit.</li>
<li>Drag OLEDB Source configure to read SQL Table (e.g. Accounts)</li>
<li>Drag ZS Template Transform from the toolbox. Connect OLEDB Source to Template Transform. If you need flexible XML Generation then use <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">XML Generator Transform</a> but it may require some learning curve so for simplicity we are skipping that from this article.</li>
<li>Enter your SOAP request in the template text (like below) you like to call (This is obtained from the previous section &#8211; using <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/">tool like SoapUI</a>)<br />
<strong>For Example:</strong> To create a new account you can use enter like below. Replace xxxxxxxxxx with Columns placeholder.<br />
To insert Column name as Placeholder click &lt;&lt;Insert Placeholder&gt;&gt; and then Select [Columns] node. Template Transform outputs column name <strong>TemplateOutput</strong>. You can use this as Body to feed next step (i.e. Call Workday API using Web API Destination )When you insert placeholder to make sure you use XML Encoded Columns if you expecting a Long text or special characters part of your data.<br />
Syntax for encoded value is   <pre class="crayon-plain-tag">&lt;%CustomerName,FUN_XMLENC%&gt;</pre>  . You don&#8217;t need <strong>FUN_XMLENC</strong> for numeric fields. For normal placeholder without encoding use just name with column placeholder indicators e.g.  <pre class="crayon-plain-tag">&lt;%Amount%&gt;</pre>
<pre class="crayon-plain-tag">&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bsvc="urn:com.workday/bsvc"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;bsvc:Workday_Account_for_Worker_Add&gt;
         &lt;bsvc:Worker_Reference&gt;
            &lt;!--You have a CHOICE of the next 2 items at this level--&gt;
            &lt;bsvc:Employee_Reference&gt;
               &lt;bsvc:Integration_ID_Reference&gt;
                  &lt;bsvc:ID&gt;xxxxxxxxxx&lt;/bsvc:ID&gt;
               &lt;/bsvc:Integration_ID_Reference&gt;
            &lt;/bsvc:Employee_Reference&gt;
            &lt;bsvc:Contingent_Worker_Reference&gt;
               &lt;bsvc:Integration_ID_Reference&gt;
                  &lt;bsvc:ID&gt;xxxxxxxxxxxx&lt;/bsvc:ID&gt;
               &lt;/bsvc:Integration_ID_Reference&gt;
            &lt;/bsvc:Contingent_Worker_Reference&gt;
         &lt;/bsvc:Worker_Reference&gt;
         &lt;bsvc:Workday_Account_for_Worker_Data&gt;
            &lt;!--type: string--&gt;
            &lt;bsvc:User_Name&gt;xxxxxxxxxxxxxx&lt;/bsvc:User_Name&gt;
         &lt;/bsvc:Workday_Account_for_Worker_Data&gt;
      &lt;/bsvc:Workday_Account_for_Worker_Add&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
<div id="attachment_2550" style="width: 1170px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-create-soap-request-xml-template.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2550" class="size-full wp-image-2550" src="https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-create-soap-request-xml-template.png" alt="Template Transform - Create Workday SOAP Request - Create new records using SSIS" width="1160" height="630" srcset="https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-create-soap-request-xml-template.png 1160w, https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-create-soap-request-xml-template-300x163.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-create-soap-request-xml-template-768x417.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-create-soap-request-xml-template-1024x556.png 1024w" sizes="(max-width: 1160px) 100vw, 1160px" /></a><p id="caption-attachment-2550" class="wp-caption-text">Template Transform &#8211;<br />Create Workday SOAP Request &#8211; Create new records using SSIS</p></div></li>
<li>Drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">ZS Web API Destination</a> from SSIS Toolbox. Connect Template Transform to Web API Destination.</li>
<li>Configure Web API Destination as below (See we used same HTTP connection created in the previous section)</li>
<li>Select HTTP Connection</li>
<li>Select Input Column for Body (select <strong>TemplateOutput</strong>)</li>
<li>Select Body Content Type as <strong>XML (text/xml;charset=UTF-8)</strong></li>
<li>Click Raw Edit above Headers grid. Enter following text (We just need one header)<br />
<pre class="crayon-plain-tag">SOAPAction: ""</pre>
<div id="attachment_2551" style="width: 1116px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-loading-sql-server-data-using-xml-soap-request.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2551" class="size-full wp-image-2551" src="https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-loading-sql-server-data-using-xml-soap-request.png" alt="SSIS Web API Destination - Loading SQL Server data to Workday (SOAP Call - Create, Insert, Update, Delete Records)" width="1106" height="693" srcset="https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-loading-sql-server-data-using-xml-soap-request.png 1106w, https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-loading-sql-server-data-using-xml-soap-request-300x188.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-loading-sql-server-data-using-xml-soap-request-768x481.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-loading-sql-server-data-using-xml-soap-request-1024x642.png 1024w, https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-workday-write-data-loading-sql-server-data-using-xml-soap-request-436x272.png 436w" sizes="(max-width: 1106px) 100vw, 1106px" /></a><p id="caption-attachment-2551" class="wp-caption-text">SSIS Web API Destination &#8211;<br />Loading SQL Server data to Workday (SOAP Call &#8211; Create, Insert, Update, Delete Records)</p></div></li>
<li>Now you can connect Web API Destination Output (Blue Arrow to Either XML Parser or some other Destination). Web API destination gives you a response in Raw XML Format. This article explains <a href="https://zappysys.com/blog/load-data-from-sql-server-to-elasticsearch-using-ssis/#What_if_I_want_more_After_upserting_data_useWeb_API_Destinationfurther" target="_blank" rel="noopener">how to use JSON or XML Parser to parse API response</a> coming from Web API destination.</li>
</ol>
<h2>Video Tutorial (See Part#4) &#8211; Create XML and POST data to SOAP Web Service or REST API</h2>
<p>Now lets look at examples of creating XML from multiple data sources and POST XML request to SOAP Web Service URL or any other XML Based REST API URL. This video has 5 parts to cover full length tutorial but if you want to fast forward to see XML Generator Transform and Web API Destination then see part#4.<br />
<a href="https://zappysys.com/blog/load-sql-server-data-workday-using-ssis-soap-api/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FTjTexGzBF5g%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>Sending complex SOAP Request (Nested Parent-Child Array)</h2>
<p>If you have to call more complex SOAP request which requires Parent-child structure (Nested Array) then you cant use Template Transform. In that case, check <a href="https://zappysys.zendesk.com/hc/en-us/articles/360002575234-How-to-generate-Workday-SOAP-Request-XML-in-SSIS" target="_blank" rel="noopener">this article</a> for real-world example.</p>
<div id="attachment_3167" style="width: 674px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-create-soap-request-nested-xml-multiple-inputs-post-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3167" class="size-full wp-image-3167" src="https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-create-soap-request-nested-xml-multiple-inputs-post-data.png" alt="Create nested XML for SOAP Request - Multiple inputs (POST data to API using SSIS Web API Destination)" width="664" height="520" srcset="https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-create-soap-request-nested-xml-multiple-inputs-post-data.png 664w, https://zappysys.com/blog/wp-content/uploads/2018/01/ssis-create-soap-request-nested-xml-multiple-inputs-post-data-300x235.png 300w" sizes="(max-width: 664px) 100vw, 664px" /></a><p id="caption-attachment-3167" class="wp-caption-text">Create nested XML for SOAP Request &#8211; Multiple inputs (POST data to API using SSIS Web API Destination)</p></div>
<h2>Extract single XML node from SOAP Response</h2>
<p>There will be a time when you need to extract just one value out of your response and save into SSIS variable / use it later on. If that&#8217;s the case then <a href="https://zappysys.com/blog/ssis-extract-single-xml-node-using-xpath-soap-response/" target="_blank" rel="noopener">refer to this article</a>.</p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>In this article we have learned how to load data from SQL Server to Workday using SSIS ( drag and drop approach without coding). Combination of few ZappySys Components (e.g. Web API Destination, XML Generator ) makes it super simple to call any Web API to load data from one system to API endpoint. <a href="https://zappysys.com/products/ssis-powerpack/">Download SSIS PowerPack</a> to try many other automation scenarios not discussed in this article.</p>
<p>The post <a href="https://zappysys.com/blog/load-sql-server-data-workday-using-ssis-soap-api/">Load SQL Server data to Workday using SSIS / SOAP API</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to generate XML with namespace / prefix in SSIS</title>
		<link>https://zappysys.com/blog/ssis-generate-xml-namespace-prefix/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 18 Oct 2017 17:39:37 +0000</pubDate>
				<category><![CDATA[SSIS XML Export Task]]></category>
		<category><![CDATA[SSIS XML Generator Transform]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis export xml task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[ssis xml generator transform]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2191</guid>

					<description><![CDATA[<p>Introduction In this post you will see how to generate XML which has namespace and prefix for elements. We will use SSIS XML Generator Transform for this purpose. Common pattern would be generate XML SOAP message using XML Generator Transform and send to Web service using SSIS Web API Destination. For full tutorial on how [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-generate-xml-namespace-prefix/">How to generate XML with namespace / prefix in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><img loading="lazy" decoding="async" class="alignleft wp-image-2206" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform.png" alt="" width="90" height="90" />In this post you will see how to generate XML which has namespace and prefix for elements. We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">SSIS XML Generator Transform</a> for this purpose. Common pattern would be generate XML SOAP message using XML Generator Transform and send to Web service using <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">SSIS Web API Destination</a>. For full tutorial on how to export XML using SSIS <a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/" target="_blank" rel="noopener">check this link</a>.</p>
<p>&nbsp;</p>
<h2>Understanding XML Namespace and Prefix</h2>
<p>Just like how many programming languages offer concept called namespace to avoid similar name conflict for classes, XML also has <a href="https://en.wikipedia.org/wiki/XML_namespace" target="_blank" rel="noopener">namespace</a> concept.</p>
<p><strong>Sample XML with namespace and prefix</strong></p><pre class="crayon-plain-tag">&lt;?xml version="1.0"?&gt;
&lt;soapenv:Envelope xmlns:p1="http://someurl-1" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
	&lt;soapenv:Body&gt;
		&lt;p1:CustomerID&gt;CID1&lt;/p1:CustomerID&gt;
		&lt;p1:CompanyName&gt;some company name&lt;/p1:CompanyName&gt;
	&lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre><p>
If you notice in above XML there are two important things. Under &lt;<strong>soapenv:Envelope&gt;</strong> element you have <strong>xmlns:p1</strong> and <strong>xmlns:soapenv</strong> attributes. Basically these are two namespace declarations and they both use different prefix (i.e. p1 and soapenv). Once you define namespace prefix you can use in the declaring element or any child element under that node.</p>
<p><strong>Syntax for XML Namespace declaration:</strong></p><pre class="crayon-plain-tag">xmlns:yourprefix=&quot;url or unique identifier&quot;</pre><p>
<h2>Example &#8211; Using SSIS XML Generator Transform</h2>
<p>Now lets look at how to generate XML using SSIS XML Generator Transform. This same technique can be used by SSIS Export XML Task.</p>
<ol>
<li>Download and Install SSIS PowerPack <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">from here</a> (Skip this if you already did)</li>
<li>Open Visual Studio and create new SSIS Package</li>
<li>Drag Data Flow Task from Control Flow 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>Drag <a href="https://zappysys.com/products/ssis-powerpack/dummy-data-source-free/" target="_blank" rel="noopener">ZS Dummy Data Source</a> (You can use any source you like. e.g. OLEDB Source)</li>
<li>Change Template to Customer to create fake customer data. Click OK to save.</li>
<li>Now drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">ZS XML Generator Transform</a></li>
<li>Connect Source to XML Generator</li>
<li>Double click XML Generator to configure.</li>
<li>Go to Options tab and change following setting
<ol>
<li>under Namespaces define two namespaces as below (Change p1 to desired prefix)<br />
p1=http://someurl, soapenv=http://schemas.xmlsoap.org/soap/envelope/</li>
<li>Change Root element name to Envelope</li>
<li>Change Root Element Prefix to soapenv
<div id="attachment_2192" style="width: 989px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2192" class="size-full wp-image-2192" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings.png" alt="Configure SSIS XML Generator Transform - Define namespace and prefix , root element" width="979" height="510" srcset="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings.png 979w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings-300x156.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings-768x400.png 768w" sizes="(max-width: 979px) 100vw, 979px" /></a><p id="caption-attachment-2192" class="wp-caption-text">Configure SSIS XML Generator Transform &#8211; Define namespace and prefix , root element</p></div></li>
</ol>
</li>
<li>Now go to layout tab and select dataset and click Edit</li>
<li>Change default Row element name to Body and prefix to soapenv as below. Click OK to save
<div id="attachment_2193" style="width: 820px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2193" class="size-full wp-image-2193" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix.png" alt="Configure SSIS XML Generator Transform - Change Row element name and prefix " width="810" height="543" srcset="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix.png 810w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix-300x201.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix-768x515.png 768w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix-272x182.png 272w" sizes="(max-width: 810px) 100vw, 810px" /></a><p id="caption-attachment-2193" class="wp-caption-text">Configure SSIS XML Generator Transform &#8211; Change Row element name and prefix</p></div></li>
<li>Now right click on Mappings folder and Click &#8220;Add Elements&#8221; or click in the toolbar icon.</li>
<li>On the Add Elements dialog
<ol>
<li>select Add multiple option.</li>
<li>Change Prefix to p1 (or whatever you entered before on Options tab)</li>
<li>Select columns you want to output in XML
<div id="attachment_2194" style="width: 832px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2194" class="size-full wp-image-2194" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix.png" alt="Configure SSIS XML Generator Transform - Add elements with prefix " width="822" height="676" srcset="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix.png 822w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix-300x247.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix-768x632.png 768w" sizes="(max-width: 822px) 100vw, 822px" /></a><p id="caption-attachment-2194" class="wp-caption-text">Configure SSIS XML Generator Transform &#8211; Add elements with prefix</p></div></li>
</ol>
</li>
<li>Now you will see preview update for your XML layout as below
<div id="attachment_2195" style="width: 1109px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2195" class="size-full wp-image-2195" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix.png" alt="SSIS XML Generator Transform - Preview of complex XML using namespace and prefix" width="1099" height="668" srcset="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix.png 1099w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix-300x182.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix-768x467.png 768w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix-1024x622.png 1024w" sizes="(max-width: 1099px) 100vw, 1099px" /></a><p id="caption-attachment-2195" class="wp-caption-text">SSIS XML Generator Transform &#8211; Preview of complex XML using namespace and prefix</p></div></li>
<li>Now attach your XML Generator Transform to some downstream component such as ZS Trash Destination and run the package</li>
</ol>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>Using SSIS PowerPack you can generate complex XML in few clicks. <a href="https://zappysys.com/products/ssis-powerpack/">Download SSIS PowerPack</a> for FREE Trial and discover many more features.</p>
<p>The post <a href="https://zappysys.com/blog/ssis-generate-xml-namespace-prefix/">How to generate XML with namespace / prefix in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to export XML from SQL Server using SSIS</title>
		<link>https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 26 Apr 2017 14:14:11 +0000</pubDate>
				<category><![CDATA[SSIS XML Generator Transform]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis export xml task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[ssis xml generator transform]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=1115</guid>

					<description><![CDATA[<p>Introduction In our previous blog post we saw how to import xml into SQL server using SSIS. In this post we will see how to generate xml in SSIS. If you wish to export JSON rather than XML then check this article To produce complex nested XML you can use following two task/components. Video Tutorial &#8211; Create XML [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/">How to export XML from SQL Server using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our previous blog post we saw <a href="https://zappysys.com/blog/ssis-import-xml-file-sql-server-parse-xml/" target="_blank" rel="noopener">how to import xml into SQL server using SSIS</a>. In this post we will see how to generate xml in SSIS. If you wish to <a href="//zappysys.com/blog/export-json-from-sql-server-using-ssis/" target="_blank" rel="noopener">export JSON rather than XML then check this article</a></p>
<p>To produce complex nested XML you can use following two task/components.</p>
<div class="su-table su-table-alternate">
<table>
<tbody>
<tr>
<td width="36"><img decoding="async" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task.png" alt="Custom SSIS Tasks - Export XML File Task" width="32" /></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-export-xml-file-task/" target="_blank" rel="noopener">Export XML File Task</a></td>
</tr>
<tr>
<td width="36"><img loading="lazy" decoding="async" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-generator-transform.png" alt="SSIS XML Generator Transform" width="32" height="32" /></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">XML Generator Transform</a></td>
</tr>
</tbody>
</table>
</div>
<h2>Video Tutorial &#8211; Create XML in SSIS</h2>
<p>Below video tutorial will show you how to produce complex XML from single or multiple input datasets using SSIS.</p>
<p>Techniques illustrated in below video is almost identical for SSIS Export XML File Task and SSIS XML Generator Transform&#8230; but for demonstration we will use XML Generator Transform. If you wish to use Export XML File task then dataset will be Table or Query rather than Data flow Input.<br />
<a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FPLfIxLdaf-p3kZkPonLYlPuKf_78XhAY7_%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>Here is another video </p>
<a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FDlWwhXwJRhU%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>SSIS XML Generator Transform</h2>
<p>Use <a href="//zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">SSIS XML generator Transform</a> when you want to produce XML inside data flow and feed to downstream system or save to XML file (You can use Flat File destination). If you have need for more flexible approach or save XML into SSIS Variable so you can <a href="https://zappysys.com/blog/http-post-in-ssis-send-data-to-web-api-url-json-xml/" target="_blank" rel="noopener">POST XML data to Web API or SOAP webservice call</a> then use Export XML File Task.</p>
<h3>SSIS XML Generator Transform &#8211; Generate XML and save to file</h3>
<div id="attachment_1126" style="width: 536px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/04/ssis-create-xml-output-export-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1126" class="size-full wp-image-1126" src="//zappysys.com/blog/wp-content/uploads/2017/04/ssis-create-xml-output-export-file.png" alt="SSIS XML generator transform - Create XML Output inside Data flow" width="526" height="410" srcset="https://zappysys.com/blog/wp-content/uploads/2017/04/ssis-create-xml-output-export-file.png 526w, https://zappysys.com/blog/wp-content/uploads/2017/04/ssis-create-xml-output-export-file-300x234.png 300w" sizes="(max-width: 526px) 100vw, 526px" /></a><p id="caption-attachment-1126" class="wp-caption-text">SSIS XML generator transform &#8211; Create XML Output inside Data flow</p></div>
<h2>SSIS Export XML File Task</h2>
<p>When you have need to generate XML from multiple SQL query / tables and save into XML File or SSIS Variable then you can consider Export XML File Task. Few options available in Export File Task which are not found in XML Generator Transform such as Compression, Splitting options, Simple export without Layout.</p>
<h3>SSIS Export XML File Task &#8211; Select Source Tables, Queries, Connection</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Select Source Tables, Queries, Connection" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task-source-tables.png" alt="SSIS ExportXML File Task - Select Source Tables, Queries, Connection" /></p>
<h3>SSIS Export XML File Task &#8211; Split file options (Split by Size, Row count and Group by column</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Split file options (Split by Size, Row count and Group by column" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task-split-file-options.png" alt="SSIS ExportXML File Task - Split file options (Split by Size, Row count and Group by column" /></p>
<h3>SSIS Export XML File Task &#8211; Split file options (Split by Size, Row count and Group by column</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Split file options (Split by Size, Row count and Group by column" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task-split-file-options.png" alt="SSIS ExportXML File Task - Split file options (Split by Size, Row count and Group by column" /></p>
<h2>Create Input Datasets</h2>
<p>First step to product XML is define input datasets. If you have no parent child relation (e.g. Customer and Orders) then most likely you will need one dataset. If you are using XML Generator Transform then any attached inputs to your transform becomes datasets. First dataset is automatically set to Root dataset.</p>
<p>For Export XML File task you have to define datasets manually. You need to pick connection manager and then select Table or Query. To make query dynamic you can use Variable Placeholder</p><pre class="crayon-plain-tag">select * from MyTable Where Month='{{User::varMonthName}}'</pre><p>
<h3>SSIS Export XML File Task &#8211; Layout Editor (Define nested elements and Parent-Child relation)</h3>
<h2><img decoding="async" title="SSIS Export XML File Task - Layout Editor (Define nested elements and Parent-Child relation)" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-generator-define-shape-nested-xml.png" alt="SSIS ExportXML File Task - Layout Editor (Define nested elements and Parent-Child relation)" /></h2>
<div>
<h3>SSIS Export XML File Task &#8211; Add/Edit input Dataset</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Add/Edit Dataset" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-task-add-edit-input-dataset.png" alt="SSIS ExportXML File Task - Add/Edit input Dataset" /></p>
</div>
<h2>Create XML Elements /Attributes</h2>
<p>XML Element has start and end tags (end tag is optional if no children elements found). To add column as Element you can click on Add Element option.</p>
<p>Example of Elements</p><pre class="crayon-plain-tag">&lt;rootelement&gt;
  &lt;rowelement&gt;&lt;prop1element&gt;AAA&lt;/prop1element&gt;&lt;/rowelement&gt;
  &lt;rowelement&gt;&lt;prop1element /&gt;&lt;/rowelement&gt;
  &lt;rowelement&gt;&lt;prop1element&gt;CCC&lt;/prop1element&gt;&lt;/rowelement&gt;
&lt;/rootelement&gt;</pre><p>
<h3>SSIS Export XML File Task &#8211; Layout Editor Right Click Menu</h3>
<h2><img decoding="async" title="SSIS Export XML File Task - Layout Editor Right Click Menu" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-layout-editor-right-click-menu.png" alt="SSIS ExportXML File Task - Layout Editor Right Click Menu" /></h2>
<div>
<h3>SSIS Export XML File Task &#8211; Add/Edit Attribute</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Add/Edit Attribute" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-generator-add-edit-attributes.png" alt="SSIS ExportXML File Task - Add/Edit Attribute" /></p>
</div>
<h2>Create nested XML elements (indentation)</h2>
<p>When you need nested element (e.g. &lt;LocationInfo&gt;&lt;ZipCode&gt;xxxxxx&lt;/ZipCode&gt;&lt;/LocationInfo&gt; ) then Add element and check Unbound option on the UI (e.g. add LocationInfo as Unbound).</p>
<h2>Setting Advanced Option</h2>
<p>In this section you will learn how to set many advanced options for XML generation.</p>
<h3>SSIS Export XML File Task &#8211; Select XML Format Options</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Select XML Format Options" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task-target-format-options.png" alt="SSIS ExportXML File Task - Select XML Format Options" /></p>
<h3>Handling NULL in XML output</h3>
<p>By default NULL attributes or elements not included in output because its hard to identify Blank string vs NULL string. If you wish to explicitly flag NULL items in output then you may uncheck Do not include NULL option. By doing so you will notice two changes. In your root node xmlns:xsi attribute is added to add standard namespace and when element is NULL you will see xsi:nil=&#8221;true&#8221; in the self closing element tag. This indicates that column data is NULL. If you see self closing tab without xsi:nil=&#8221;true&#8221; then its Blank value rather than NULL.</p>
<h3>Define XML Namespace (Prefix)</h3>
<p>By default no XML namespace is defined in the XML output. But if you wish to include any attribute or element with prefix then it requires namespace declaration. For more information on how to create XML with namespace <a href="https://zappysys.com/blog/ssis-generate-xml-namespace-prefix/" rel="noopener" target="_blank">check this article</a>.</p>
<p>Consider the following example. It has some prefix called ns1 for element and ns2 for attribute. To achieve such format make sure you define two namespaces on XML Options tab (e.g. ns1=http://someurl1,ns2=http://someurl2 ). Once you do this ns1 and ns2 can be used as prefix for any element or attribute.</p>
<p>Example of Namespace/Prefix use</p><pre class="crayon-plain-tag">&lt;data xmlns:ns1="http://someurl1" xmlns:ns2="http://someurl2" &gt;
  &lt;ns1:row ns2:id="111"&gt;&lt;prop1&gt;AAA&lt;/prop1&gt;&lt;/ns1:row&gt;
&lt;/data&gt;</pre><p>
&nbsp;</p>
<h3>Using XML Namespace Prefix for Element or Attributes</h3>
<p>In order to use namespace you have to set Prefix property for any Element or Attribute when you Add them. For example to add element &lt;row&gt; with prefix ns1 (e.g. &lt;ns1:row&gt; ) you have to set prefix to ns1 on the Add/Edit Element UI. Before you can use Prefix make sure namespace is defined as per previous section.</p>
<h3>Removing XML declaration</h3>
<p>Some times you have requirement to omit XML declaration (e.g. first line  &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt; ). For that check &#8220;Do not output XML declaration&#8221; option on XML options tab.</p>
<h3>Remove Invalid XML Characters</h3>
<p>If you ever encounter invalid XML characters and want to remove them <a href="https://zappysys.com/blog/how-to-remove-invalid-characters-from-xml-using-ssis-and-regex/" target="_blank" rel="noopener">then check this article</a></p>
<h3>Change / Remove Root Element from output</h3>
<p>By default XML document has root element called &#8220;Root&#8221; (See XML Options tab to change this). You can change this to custom name or  remove it if you wish to hide start and end tag of root element from output.</p>
<h2>Change / Removing XML Row Element from output</h2>
<p>By default row of dataset will start with default Row element (e.g. &lt;DatasetRow&gt;&#8230; &lt;/DatasetRow&gt;). if you wish to hide those start and end tag then make sure you remove default Row element name in Dataset Declaration (Edit dataset and remove Row Element name)</p>
<h2>Define Parent Child Join in XML datasets (One to Many)</h2>
<p>If you have parent child relationship in XML (e.g. each Customer Tag has multiple Orders) then you need to define at least two datasets (One for parent (i.e. Customer) and one for Child (i.e Orders)).</p>
<p>&nbsp;</p>
<div style="width: 699px" class="wp-caption alignnone"><img loading="lazy" decoding="async" title="SSIS Export XML File Task - Add/Edit Document Array" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-generator-add-edit-document-array.png" alt="SSIS Export XML File Task - Add/Edit Document Array" width="689" height="384" /><p class="wp-caption-text">Define Parent to Child Relationship for XML Output (One to Many JOIN)</p></div>
<p>&nbsp;</p>
<h2>Making things Dynamic (Query Parameter / Layout Information)</h2>
<p>To make things dynamic you can insert <a href="//zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm" target="_blank" rel="noopener">variable placeholders</a> anywhere in the editor (Look for {{Insert variable}} menu item in the editor). If you want to make entire Layout dynamic then use option to Load Layout from File or Variable. If this option is not available then consider <a href="https://zappysys.com/blog/ssis-dataflow-expression-source-component-property/" target="_blank" rel="noopener">SSIS expression to make it dynamic</a><br />
<strong>Example:</strong></p><pre class="crayon-plain-tag">select * from MyTable Where Month='{{User::varMonthName}}'</pre><p>
<h2>Controlling XML Date Time formatting (How to use ISO date)</h2>
<p>By default date/time values are exported as yyyy-MM-dd HH:mm:ss format but if you wish to change so its exported to ISO format or other format then goto XML Options tab and set Date format to yyyy-MM-ddTHH:mm:ss for ISO. If Datetime is UTC then change format to yyyy-MM-ddTHH:mm:ssZ (append &#8220;Z&#8221; at the end)</p>
<h2>Conclusion</h2>
<p>Creating nested XML may not be easy task but innovative drag and drop approach of <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> certainly makes it easy to produce complex XML with every possible option on hand. <a href="https://zappysys.com/products/ssis-powerpack/">Try SSIS PowerPack for free</a> (45+ tasks and components) and explore what else you can do with it.</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/">How to export XML from SQL Server using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
