File-based data - XML, Database, and MQTT

Overview

This Scenario describes step by step how XML data can be sent via MQTT enriched with additional data from a database. This scenario shows also how type conversion and date formatting can be implemented via the SMARTUNIFIER Mapping.

Scenario Overview

Prerequisites

1. Equipment Data - (XML file)

<?xml version="1.0" encoding="utf-8"?>
<ProductionResult>
   <OrderNumber>PO_000001</OrderNumber>
   <ProductNumber>F2PZJ55QW11</ProductNumber>
       <Date>2021-03-31T07:20:41.214Z</Date>
   <Quality>IO</Quality>
   <Quantity>5</Quantity>
</ProductionResult>

2. SQL Server (Database)

Create Table

create table DEMO_INTEGRATION_UC3_SCHEMA.CUSTOMER (MAIN_KEY bigint IDENTITY(1,1) PRIMARY KEY, CUSTOMER_NAME nvarchar(max), ORDER_NUMBER nvarchar(max))

Insert Data

INSERT INTO DEMO_INTEGRATION_UC3_SCHEMA.CUSTOMER (CUSTOMER_NAME, ORDER_NUMBER) VALUES ('DemoCompany1', 'PO_000001'); INSERT INTO DEMO_INTEGRATION_UC3_SCHEMA.CUSTOMER (CUSTOMER_NAME, ORDER_NUMBER) VALUES ('DemoCompany1', 'PO_000002'); INSERT INTO DEMO_INTEGRATION_UC3_SCHEMA.CUSTOMER (CUSTOMER_NAME, ORDER_NUMBER) VALUES ('DemoCompany2', 'PO_000003'); INSERT INTO DEMO_INTEGRATION_UC3_SCHEMA.CUSTOMER (CUSTOMER_NAME, ORDER_NUMBER) VALUES ('DemoCompany3', 'PO_000004');

3. MQTT Client (For testing)

Download the MQTT Explorer.