Merge and Store XML Files Directly to Cloud Using KingswaySoft

27 October 2023
KingswaySoft Team

As an ETL Developer, you may have use cases where you would need to process tabular data in order to produce an XML/JSON file and save it in a cloud location. Usually, this is done by first merging and creating an XML file in a local or network path and then, on a regular basis, moving it to the cloud storage. However, for users who are running their SSIS packages on the cloud via ADF and who do not wish to use local storage, this could be a roadblock. In such cases, you can instead use KingswaySoft's SSIS Productivity Pack components to write directly to the storage solution, skipping the step of writing to a local file. It also allows you to keep the data within SSIS, reducing the complexity of your SSIS package.

In this blog post, we will show you how to convert data to an XML format and create a file for that data to be saved in a cloud-based storage directly. In this demonstration, we will write our data to the Amazon S3 location. Nevertheless, the same solution applies to all supported cloud locations, including Azure Blob Storage, Box, Dropbox, OneDrive, SharePoint, etc.

We will use the following components for this case:

All the components above are available as a part of our SSIS Productivity Pack.

Design and Configuration

Let's look at the example of data flow configuration that we will use to achieve our end goal. We'll employ the Data Spawner to generate some random sample data that can be replaced with any other meaningful source components.  Next, we'll pass this data into our XML Merge component, which will take the incoming data from our source component and merge it into one SSIS column data based on the XML data structure defined in the component. Then, we can pass that XML data into our Premium File System Destination to write our XML file to Amazon S3. However, before this, we will use a Premium Derived Column component to convert the XML string into a binary data field.

DataFlow.png

Within the XML Merge component, you can set the XML data structure using the component’s Document Designer. If you already have a preset XML data structure, you can choose to import that design using the import feature.

XMLMerge.png

In the component’s XML Merge Output & Error Handling tab, you can choose the Column name; however, this will only be necessary if you intend to use the XML data as a column instead of writing it as a File.

XMLMergeOutputSettings.png

After this, we will use the Premium Derived Column function StringToBytes() to convert the XML content in string format (MergedXML) to a binary value, so that it can be used as an input of the Premium File System Destination for writing. Additionally, we have also added the column for the final file path on S3 and the file name that will eventually be saved. It is worth noting that those two values can be static or dynamic, depending on your business needs. When they need to be dynamic, most likely the values should come from upstream columns or in some cases an SSIS variable.

Premium Derived Column.png

Then, we will use our Premium File System Destination Component as our Destination component. This allows for a greater variety of connections compared to the XML Destination component. You can find the list of connections in our Help Manual for Premium File System Destination. Within the Premium File System Destination Component, you can connect to a connection manager of your choice, and in our case, we will be using the Amazon S3 Connection Manager.

PremiumFIleSystemDestination.png

You can click on the ellipses to select your File Path. You can also choose to parameterize the Destination File Path in case you need to write to different locations, such as a multiple bucket or a different folder on Amazon S3.

AmazonS3DestionationPath.png

Once the general page is done, go to the columns page and perform the required mappings as shown below. Essentially, we need to make sure that we provide a path, a file name, and the file content for the writing.

PremiumFIleSystemDestinationColumns.png

Running the Data Flow

After executing the process, it should look like this. Whatever data you have will be merged into an SSIS column that contains the XML content in text format. This column will then be converted to binary content before passing to the Premium File System Destination component, which will decide how and where to save the file in the cloud.

DataFlowExecuted.png

Eventually, the XML data will be available as an XML File in Amazon S3, which is what we intend to achieve.

AmazonS3Final.png

Conclusion

As illustrated, the XML Merge component provides the infrastructure to generate XML file content, which can be written directly to the cloud storage solution of your choice using the Premium File System Destination component. Such design can simplify your integration solutions to make them straightforward and easy to maintain.

We hope this has helped!

 About 

Archive

December 2024 1 November 2024 3 October 2024 1 September 2024 1 August 2024 2 July 2024 1 June 2024 1 May 2024 1 April 2024 2 March 2024 2 February 2024 2 January 2024 2 December 2023 1 November 2023 1 October 2023 2 August 2023 1 July 2023 2 June 2023 1 May 2023 2 April 2023 1 March 2023 1 February 2023 1 January 2023 2 December 2022 1 November 2022 2 October 2022 2 September 2022 2 August 2022 2 July 2022 3 June 2022 2 May 2022 2 April 2022 3 March 2022 2 February 2022 1 January 2022 2 December 2021 1 October 2021 1 September 2021 2 August 2021 2 July 2021 2 June 2021 1 May 2021 1 April 2021 2 March 2021 2 February 2021 2 January 2021 2 December 2020 2 November 2020 4 October 2020 1 September 2020 3 August 2020 2 July 2020 1 June 2020 2 May 2020 1 April 2020 1 March 2020 1 February 2020 1 January 2020 1 December 2019 1 November 2019 1 October 2019 1 May 2019 1 February 2019 1 December 2018 2 November 2018 1 October 2018 4 September 2018 1 August 2018 1 July 2018 1 June 2018 3 April 2018 3 March 2018 3 February 2018 3 January 2018 2 December 2017 1 April 2017 1 March 2017 7 December 2016 1 November 2016 2 October 2016 1 September 2016 4 August 2016 1 June 2016 1 May 2016 3 April 2016 1 August 2015 1 April 2015 10 August 2014 1 July 2014 1 June 2014 2 May 2014 2 February 2014 1 January 2014 2 October 2013 1 September 2013 2 August 2013 2 June 2013 5 May 2013 2 March 2013 1 February 2013 1 January 2013 1 December 2012 2 November 2012 2 September 2012 2 July 2012 1 May 2012 3 April 2012 2 March 2012 2 January 2012 1

Tags